dcmoura / spyql

Query data on the command line with SQL-like SELECTs powered by Python expressions
https://spyql.readthedocs.io
MIT License
918 stars 25 forks source link

Find a better way of profiling the code #29

Closed dcmoura closed 2 years ago

dcmoura commented 3 years ago

https://github.com/dcmoura/spyql/pull/8#discussion_r672556002

dcmoura commented 3 years ago

We decided on having the profiler in a separate script (spyql.prof). Tentative code:

"""
Profile code with cProfile and writes output to the file spyql.stats.
Collecting profiling statistics slows down query execution.
"""
import cProfile
cProfile.run("spyql.cli.main()", "spyql.stats")