Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid materializing Result multiple times in type map
Testing methodology: - 189k rows returned from pg_type query in `build_coder_maps`. - Timing calling `PG::BasicTypeMapForQueries.new` only, figures are average of 16 iterations. runtime objects allocations Baseline : 2,027±350 ms 909 k 609 MiB Optimized: 874± 70 ms (-56%) 113 k (-88%) 113 MiB (-79%) Unfortunately performing the actual SQL query cannot easily be removed, so there is a fair bit of variance in the runtimes, however, results still show substantial improvement even when considering the worse case. If I had more time I would time the query and remove it, but that requires a bit more hacking than I would prefer, and, as said, the improvement stands either way.
- Loading branch information