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?
- X-seq: zsh-users 23565
- From: Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Optimized by doing $var instead of "$var", but does this vary to some extent?
- Date: Mon, 6 Aug 2018 14:43:33 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=xsLhIQDFtq96LoldXzi1gB4VniCcrkLaMzPC32pb//c=; b=f4tamxu7qpJ97kxaSA4s3I2hzTcmWAP+ZJfHOFSY6Ux/d+xIL+hdMYJF9vaLHF86Xt asmMMrabi2zI7PMDPo3q1Fh8RG8uJAE3LkXi3dBLxoLigPyE/z/sr7M7OMsGFNR+C88O UJr9cXjkav/2SiqlUD/q/tcavuZ6L+UDAgVTLbOFAX/A3/obhWqkSbdShlQWyoJ1MeyB YknF2zc83RvfWEayF2w/bN7on/Q24wHK5GogdxJJY6mdQzyXgvEH6LgrcywiGMyc2a+r C0rhPOUiwL5RahEXgSuUBDPeo5fJOAEtbHz0ZvYAq3uzWi2G13Z0IQdw7NjYMvtSOUzn Fm8g==
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- List-unsubscribe: <mailto:zsh-users-unsubscribe@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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