Merge lp://staging/~therve/storm/cache-compile into lp://staging/storm
Proposed by
Thomas Herve
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 400 | ||||
Proposed branch: | lp://staging/~therve/storm/cache-compile | ||||
Merge into: | lp://staging/storm | ||||
Diff against target: |
282 lines (+40/-26) 4 files modified
storm/expr.py (+14/-5) storm/info.py (+10/-11) tests/expr.py (+7/-1) tests/info.py (+9/-9) |
||||
To merge this branch: | bzr merge lp://staging/~therve/storm/cache-compile | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gustavo Niemeyer | Approve | ||
Jamu Kakar (community) | Approve | ||
Free Ekanayaka (community) | Approve | ||
Review via email: mp+71473@code.staging.launchpad.net |
Description of the change
Here it is. The branch adds a new attribute on Table and Column to cache the compilation. AFAIU, those compilations don't depend on the state, so we can store directly the value. It also changes the ClassInfo to store the table as a Table object instead of a SQLToken, to go through the compile_table logic.
I made a quick benchmark to show the gains:
10 inserts, 3 colums | 1.68s | 1.55s | 7.8%
100 insersts, 3 columns | 14.15s | 12.79s | 9.6%
20 insersts, 10 columns | 5.38s | 4.71s | 12.4%
I think it's worth it considering the low impact of the changes.
To post a comment you must log in.
Nice!
Would you mind to repeat the benchmark with 1000 inserts and 10 columns each, to see a bit better the effects? The first number feels a bit suspect (hard to believe 10 inserts would take 1.6 seconds).