Skip to content
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

Adding an index to monkeytype.sqlite3 speeds up stub generation #300

Closed
Feuermurmel opened this issue Aug 25, 2023 · 1 comment · Fixed by #301
Closed

Adding an index to monkeytype.sqlite3 speeds up stub generation #300

Feuermurmel opened this issue Aug 25, 2023 · 1 comment · Fixed by #301

Comments

@Feuermurmel
Copy link
Contributor

I've noticed that adding an index to monkeytype.sqlite3 speeds up stub generation a bit:

(venv) $ time monkeytype stub foo.bar > /dev/null

real	0m1.673s
user	0m1.242s
sys	0m0.419s
(venv) $ sqlite3 monkeytype.sqlite3
SQLite version 3.37.0 2021-12-09 01:34:53
Enter ".help" for usage hints.
sqlite> create index foo on monkeytype_call_traces (module, created_at);
sqlite> ^D
(venv) $ time monkeytype stub foo.bar > /dev/null

real	0m1.009s
user	0m0.873s
sys	0m0.104s

My monkeytype.sqlite3 is 2.6 GB in size, which resulted from running our test suite once.

@Feuermurmel Feuermurmel changed the title Adding an index to monkeytype.sqlite3 speeds generating stubs Adding an index to monkeytype.sqlite3 speeds up stup generation Aug 25, 2023
@carljm
Copy link
Contributor

carljm commented Aug 25, 2023

Nice find! Would you be up for submitting a PR that adds this index to initialization of the sqlite db?

@carljm carljm changed the title Adding an index to monkeytype.sqlite3 speeds up stup generation Adding an index to monkeytype.sqlite3 speeds up stub generation Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants