Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slurping a file (was: more spllitting travails)
- X-seq: zsh-users 29654
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Slurping a file (was: more spllitting travails)
- Date: Sat, 10 Feb 2024 22:49:17 -0600
- Archived-at: <https://zsh.org/users/29654>
- In-reply-to: <CAHYJk3R4OPEKxTNFWM9SYzNYLVA0kP9vJ2xDEe4d10swwkYVsQ@mail.gmail.com>
- List-id: <zsh-users.zsh.org>
- References: <CAH+w=7ZJsr7hGRvD8f-wUogPcGt0DMOcPyiYMpcwCsbBNkRwuQ@mail.gmail.com> <CAA=-s3zc5a+PA7draaA=FmXtwU9K8RrHbb70HbQN8MhmuXTYrQ@mail.gmail.com> <CAH+w=7bAWOF-v36hdNjaxBB-5rhjsp97mAtyESyR2OcojcEFUQ@mail.gmail.com> <205735b2-11e1-4b5e-baa2-7418753f591f@eastlink.ca> <CAH+w=7Y5_oQL20z7mkMUGSLnsdc9ceJ3=QqdAHVRF9jDZ_hZoQ@mail.gmail.com> <CAA=-s3x4nkLST56mhpWqb9OXUQR8081ew63p+5sEsyw5QmMdpw@mail.gmail.com> <CAH+w=7Yi+M1vthseF3Awp9JJh5KuFoCbFjLa--a22BGJgEJK_g@mail.gmail.com> <CAN=4vMpexntEq=hZcmsiXySy-2ptXMvBKunJ1knDkkS+4sYYLA@mail.gmail.com> <CAH+w=7aT-gbt7PRo=uvPK5=+rR3X-PE7nEssOkh+=fxwdeG_7w@mail.gmail.com> <CAN=4vMq=E4s2a0sDFq-Mc8=pVzPnYOM9NaTmesgXQqi+O+mHpw@mail.gmail.com> <20240210204803.2ogpi5h752uzwf6e@chazelas.org> <CAHYJk3R4OPEKxTNFWM9SYzNYLVA0kP9vJ2xDEe4d10swwkYVsQ@mail.gmail.com>
On Sat, Feb 10, 2024 at 6:59 PM Mikael Magnusson <mikachu@xxxxxxxxx> wrote:
>
> I believe one of the motivating factors for this function was speed,
> and copying all the data an extra time probably doesn't help with
> that.
Where's the extra copy in Stephane's version?
Roman's optimized version uses the (j::) as well, turns out it's
faster at a certain file size to build up the array and then copy it
with the join than it is to append to a string without using the
array.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author