Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Possible huge setarrvalue optimization
- X-seq: zsh-workers 40270
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Sebastian Gniazdowski <psprint@xxxxxxxxxxxxxx>
- Subject: Re: Possible huge setarrvalue optimization
- Date: Thu, 5 Jan 2017 04:13:11 +0000
- Cc: zsh-workers@xxxxxxx
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= mesmtp; bh=ls/+J1Lbf8+RAs8Sw0Mfo96+O6Y=; b=l+zu9nkkqo2O9aWNKgCJ7 hVtO50Y1puxRNL3G/aBDcfIuPLzmmlMRineZIngCfFzipc22KHJUwPhsQCcGT4Id A08pCYk/ZyEdW6kdZPTZurUujXBTOkp1NDe3tlm+HfjqaWTacelTTtE21nRsxRKv oMLEwDikL+0BE2OTBrszxk=
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= smtpout; bh=ls/+J1Lbf8+RAs8Sw0Mfo96+O6Y=; b=n1l51jHr7l5dQjoJC01a m4dQgZXOA+CApOHYfe6IERBGhlKlLa0ffXtpoL1s8IoJmgYNYGE5QeQOsRvrxpSZ 9bqRZy/6FVCvDzGvHvEUEm7V2OGIWQFgI3r7vIvMazZ8MbjTFNOftC1T8E87WiN9 KpWU+VciwAHZe/xCksDN0bg=
- In-reply-to: <kUeSixj7NdCaG0ESIFa-sBceoIHTjFIUTIfI9qy334edbaTqPGRc1401rbMmNOCrB3EL2wcirwNBrICdLYHmNfpwui3tze3Amen6fE_rVc0=@protonmail.com>
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
- References: <1479449829.1305485.791811385.14DDFE28@webmail.messagingengine.com> <1479461540.1340250.791913609.27FAD722@webmail.messagingengine.com> <1479471620.1371132.792049209.295BE093@webmail.messagingengine.com> <20161120114648.GA6953@fujitsu.shahaf.local2> <CAH+w=7YsEm=3WF_fs5Zyv9n+z7QOtwyOqss6Yv9Vpvtdqz_eiA@mail.gmail.com> <20161224171936.GA19748@fujitsu.shahaf.local2> <kUeSixj7NdCaG0ESIFa-sBceoIHTjFIUTIfI9qy334edbaTqPGRc1401rbMmNOCrB3EL2wcirwNBrICdLYHmNfpwui3tze3Amen6fE_rVc0=@protonmail.com>
Sebastian Gniazdowski wrote on Wed, Jan 04, 2017 at 13:31:52 -0500:
> You then wrote:
>
> "Should this line check that «v->pm->gsu.a.setfn == arrsetfn»?
>
> Should this line check that «pm->ename == NULL» [since arrsetfn()
> handles such arrays specially]?"
>
> I think both propositions are good, especially the ename check
I've incorporated them when I pushed (4fb4ce190ccb).
> – activated when parameter is being automatically exported – if I understand correctly. You could fix this by including code activated in the normal setter when ename is not null – like Peter did with string optimization. This way auto-exported arrays will still be optimized.
[Peter's change to which you refer is 39995.]
Thanks for the suggestion. I agree the pm->ename != NULL case could be
optimised further, however, I don't intend to look into that myself.
Here's also an addendum to 39995.
diff --git a/Src/params.c b/Src/params.c
index c64d748..fc313cd 100644
--- a/Src/params.c
+++ b/Src/params.c
@@ -3458,6 +3458,8 @@ strsetfn(Param pm, char *x)
pm->node.flags |= PM_NAMEDDIR;
adduserdir(pm->node.nam, x, 0, 0);
}
+ /* If you update this function, you may need to update the
+ * `Implement remainder of strsetfn' block in assignstrvalue(). */
}
/* Function to get value of an array parameter */
Thanks again for the review.
Cheers,
Daniel
Messages sorted by:
Reverse Date,
Date,
Thread,
Author