Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Refactor for a more efficient prepare_table() (#228)
Refactor code in prepare_table() to drastically reduce database queries required from O(n) db queries to O(1) db queries, where n is the number of columns in the table. This change improves test_reserved_keywords() running time and closes #142 Running `time poetry run pytest -k 'test_reserved_keywords'` on main branch gave me an average running time of 33.441 seconds across three runs: ``` real 0m33.539s user 0m21.294s sys 0m0.531s real 0m33.300s user 0m21.272s sys 0m0.472s real 0m33.484s user 0m21.337s sys 0m0.503s ``` Running `time poetry run pytest -k 'test_reserved_keywords'` after my changes gave me an average running time of 1.271 seconds across three runs: ``` real 0m1.232s user 0m1.005s sys 0m0.056s real 0m1.299s user 0m1.018s sys 0m0.105s real 0m1.281s user 0m1.024s sys 0m0.082s ```
- Loading branch information