I ran the performance tests again with script formatting them differently – they are aggregated on test function, not on zsh version. This allows easier interpretation. A new conclusion is that zhalloc patch doesn't help for string_test. So the first patch (36834) speeds up string operations and also introduces increased memory usage. Best regards, Sebastian Gniazdowski On 22 October 2015 at 14:49, Sebastian Gniazdowski wrote: > On 19 October 2015 at 19:21, Bart Schaefer wrote: >> We leave that empty arena at the end, but then on the next zhalloc() >> it's still not big enough, so another one gets allocated. >> >> You could try removing that "else" to let the trailing block be freed >> again, but then we're back to needing to compare speed as well as space >> across shell versions. > > I removed the else, code works longer and memory is still allocated. > This is seen in mem-test3.txt, where there are many samples and large > numbers, and in perf-test.txt, where there noted is long running time > (numbers are milliseconds) > > I wrote perf-test.zsh to automatically perform performance tests: > https://github.com/psprint/zsh-tools/ > > With it and with mem-test.zsh I tested following zsh variants: > - 5.0.2 osx > - newheaps patch (zsh-newheaps-only) > - newheaps and zhalloc patch 36836 (zsh-newheaps-zhalloc) > - zhalloc and the previous patch 36834 (zsh-head-both-patches) > - all three patches (zsh-newheaps-three-patches) > - a 5.1.1-dev-0 clean zsh > - the empty arena else removed > > My conclusions: > - 36834 introduces high memory usage; I would suggest to use only two > optimizations – newheaps and zhalloc; my znavtools are instant fast > with them, what's slower is searching (wrote search_test function, > results attached); basically half of pattern search speedup is lost > with 36834, however what's gained is beautiful memory usage, without > firefox-like values for RES (~700 MB); newheaps is responsible for > instant-responsivity of my script, 36836 for much faster searching – > that's a good compromise > > - searching with patterns through very large arrays (700k) allocates > 264 MB of memory regardless of zsh version; this probably tells > something > > - still not sure why 36834 allocates much memory for the string test > > - newheaps makes function calls longer, but it's not a substantial > difference – 21196 ms vs. 18549 ms > > Best regards, > Sebastian Gniazdowski