avinassh / fast-sqlite3-inserts

Some bunch of test scripts to generate a SQLite DB with 1B rows in fastest possible way
MIT License
381 stars 38 forks source link

Avoid the slow Display::fmt trait for area code generation #17

Closed red15 closed 1 year ago

red15 commented 3 years ago

As described in the other PR #12 I discovered the "slow" Display::fmt being called for formatting the area code using perf.

This PR does limit the generated area code to numbers above 100_000 where before it could be less, thus losing some randomness, but it's about the same "trick" as used in #2 for the python side.

avinassh commented 3 years ago

Thank you! Could you post the before and after numbers?

Kerollmops commented 2 years ago

@avinassh for your information this part has been highly speed-up by https://github.com/avinassh/fast-sqlite3-inserts/pull/19/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759R16-R33 by using a new format function and storing the result into a TinyStr8 type.