-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Symbol hashes #278
Comments
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Nov 10, 2019
This adds: * PG::Result#field_name_type= * PG::Result#field_name_type * PG::Result#field_names_as Symbol comparison and lookup is faster, since the string hash is generated at Symbol creation. So retrieval of Symbol based field names is somewhat slower, but this is easily outperformed in frameworks that do a lot of lookups. Fixes ged#278
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Nov 10, 2019
This adds: * PG::Result#field_name_type= * PG::Result#field_name_type * PG::Result#field_names_as Symbol comparison and lookup is faster, since the string hash is generated at Symbol creation. So retrieval of Symbol based field names is somewhat slower, but this is easily outperformed in frameworks that do a lot of lookups. Fixes ged#278
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Nov 10, 2019
This adds: * PG::Result#field_name_type= * PG::Result#field_name_type * PG::Result#field_names_as Symbol comparison and lookup is faster, since the string hash is generated at Symbol creation. So retrieval of Symbol based field names is somewhat slower, but this is easily outperformed in frameworks that do a lot of lookups. This raises ruby version requirement to 2.2, since it depends on GC'able symbols. Fixes ged#278
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Nov 16, 2019
This adds: * PG::Result#field_name_type= * PG::Result#field_name_type * PG::Result#field_names_as Symbol comparison and lookup is faster, since the string hash is generated at Symbol creation. So retrieval of Symbol based field names is somewhat slower, but this is easily outperformed in frameworks that do a lot of lookups. This raises ruby version requirement to 2.2, since it depends on GC'able symbols. Fixes ged#278
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Original report by Вячеслав Краснов (Bitbucket: slavestys, GitHub: slavestys).
Hello! Is there a possibility to make pg return symbol hashes because they work much faster than strings
The text was updated successfully, but these errors were encountered: