Grabbed a bunch of queries and timed in IPython with:
In [1]: from django_perf_rec.sql import sql_fingerprint ; from example import queries
In [2]: %%timeit
...: sql_fingerprint.cache_clear()
...: for query in queries:
...: sql_fingerprint(query)
...:
...: sql_fingerprint(query, hide_columns=False)
...:
47.7 ms ± 92.8 µs per loop (mean ± std. dev. of 7 runs, 10 loops each)
Applied some easy, obvious optimizations from reading the code, and the same took 46.9ms instead, again with tight variance. That’s ~1ms faster, or ~2%.
Grabbed a bunch of queries and timed in IPython with:
Applied some easy, obvious optimizations from reading the code, and the same took 46.9ms instead, again with tight variance. That’s ~1ms faster, or ~2%.