Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Slurping a file (was: more spllitting travails)
- X-seq: zsh-users 29655
- From: Mikael Magnusson <mikachu@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: Slurping a file (was: more spllitting travails)
- Date: Sun, 11 Feb 2024 06:04:55 +0100
- Archived-at: <https://zsh.org/users/29655>
- In-reply-to: <CAH+w=7YCHVc=hYuErziZE1Z_JSJt3AVrqC+RXq3jcMxF9M1BGw@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> <CAH+w=7YCHVc=hYuErziZE1Z_JSJt3AVrqC+RXq3jcMxF9M1BGw@mail.gmail.com>
On 2/11/24, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> 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.
Oops, I just looked at the end of the updated version and saw it had
an assignment of the read data to the passed variable and didn't
compare it properly to the original version.
--
Mikael Magnusson
Messages sorted by:
Reverse Date,
Date,
Thread,
Author