Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Optimized by doing $var instead of "$var", but does this vary to some extent?



Hello,
I just gained 60 ms (out of ~3300 ms) by replacing my paranoia-quoting
of everything i.e. [[ "$var" = "1" ]] with unquoted,
noshwordsplit-trusting [[ $var = "1" ]]. But I did this about a year
ago too in different project, and after promising initial results
things turned out to become slower. There were more array uses there,
mostly "${arr[@]}", but my tests were superficial.

Now after replacing half of code, I managed to get gain ~100 ms. Now
after replacing everything, zprof yields only 60 ms. I run zprof many
times and note shortest time, so it can be just luck.

But maybe some quotings are slowing down and some helping? Does
someone know Zsh code to hint that sometimes quoting in "$var"-like
way can help performance?

-- 
Sebastian Gniazdowski
News: https://twitter.com/ZdharmaI
IRC: https://kiwiirc.com/client/chat.freenode.net:+6697/#zplugin



Messages sorted by: Reverse Date, Date, Thread, Author