]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Some improvements to the cache key generation speed
authorFederico Caselli <cfederico87@gmail.com>
Thu, 11 Apr 2024 19:39:25 +0000 (21:39 +0200)
committerFederico Caselli <cfederico87@gmail.com>
Wed, 8 May 2024 19:35:37 +0000 (21:35 +0200)
commit6fbf00179845b800ada8e9a50e77e01838b5497a
tree1bf2c948ccf1a0816dcfb88d5c69d8c17d2ddac4
parentf0ed44e89ea83dc2f994105dcd0c471bcb54d608
Some improvements to the cache key generation speed

Optimize anon map performance
Improve bindparam cache key generation

Improvement is about 10%
(Table must be manually constructed by running
`python test/perf/compiled_extensions CacheKey` on main and in
this change while recompiling cython)

                           | change      | main      | change / main |
check_not_caching          | 0.850238500 | 0.8729132 | 0.9740241069  |
parent_table               | 0.380153900 | 0.4201198 | 0.9048702299  |
parent_orm                 | 0.524657600 | 0.575952  | 0.9109398005  |
parent_orm_join            | 0.852317200 | 0.978303  | 0.8712200617  |
many_types                 | 0.298978000 | 0.3166505 | 0.944189256   |
oracle_all_objects_query   | 0.830102500 | 0.940856  | 0.8822843241  |
oracle_table_options_query | 0.787572400 | 0.8663654 | 0.9090533856  |
oracle_column_query        | 1.020074200 | 1.1518336 | 0.8856089977  |
oracle_comment_query       | 1.054886600 | 1.1857846 | 0.8896106426  |
oracle_index_query         | 0.932308800 | 1.0719409 | 0.869738994   |
oracle_constraint_query    | 1.204755500 | 1.3571617 | 0.8877022539  |
pg_has_table_query         | 0.713250000 | 0.8550803 | 0.8341321862  |
pg_columns_query           | 1.269068400 | 1.4404266 | 0.8810364929  |
pg_table_oids_query        | 0.787948100 | 0.9132093 | 0.8628340732  |
pg_index_query             | 1.118733900 | 1.2628904 | 0.8858519314  |
pg_constraint_query        | 0.917447700 | 1.0175005 | 0.9016680581  |
pg_foreing_key_query       | 0.980781200 | 1.1213958 | 0.8746075204  |
pg_comment_query           | 0.883384900 | 1.0329165 | 0.8552336031  |
pg_check_constraint_query  | 1.043821200 | 1.229517  | 0.8489684974  |
pg_enum_query              | 0.947796800 | 1.043922  | 0.907919174   |
pg_domain_query            | 1.082338200 | 1.2296575 | 0.880194851   |
> Mean values              | -           | -         | 0.8886518305  |

Change-Id: I1c1432978d954863a3967267d599fbb3a53d5ad5
lib/sqlalchemy/sql/_util_cy.py
lib/sqlalchemy/sql/annotation.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/util/_collections_cy.pxd [new file with mode: 0644]
lib/sqlalchemy/util/_collections_cy.py
test/perf/compiled_extensions/collections_.py [moved from test/perf/compiled_extensions/collections.py with 100% similarity]
test/perf/compiled_extensions/command.py