-
- Downloads
Performance optimization of mentat.filtering.jpath.jpath_parse() function.
Implemented jpath_parse_c() as a caching variant of jpath_parse() function. Benchmarking confirmed huge performance improvement, see mentat.filtering.benchmark.bench_jpath.py for details. Another small improvement was archived by moving compilation of chunk regular expression to global module variable (14% performance increase). All module functions now use this caching variant internally. Also implemented cache_size() and cache_clear() functions for cache management. Beware, that jpath_parse_c() function does not make deep copy of returned value from cache (for performance reasons). Treat those values as read only, or suffer the consequences. (Redmine issues: #3392 and #1017)
Showing
- lib/mentat/filtering/benchmark/bench_jpath.py 143 additions, 0 deletionslib/mentat/filtering/benchmark/bench_jpath.py
- lib/mentat/filtering/jpath.py 38 additions, 6 deletionslib/mentat/filtering/jpath.py
- lib/mentat/filtering/test_jpath.py 15 additions, 0 deletionslib/mentat/filtering/test_jpath.py
Loading
Please register or sign in to comment