Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #18850

Re: poor performance while processing a file one byte a time

Path csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From John-Paul Stewart <jpstewart@personalprojects.net>
Newsgroups comp.lang.php
Subject Re: poor performance while processing a file one byte a time
Date Thu, 20 Jan 2022 12:38:06 -0500
Lines 12
Message-ID <j4tkvvFikcU1@mid.individual.net> (permalink)
References <ssbqrm$46r$1@gioia.aioe.org> <j4tfnoFu1qqU1@mid.individual.net> <ssc2a3$1v7f$1@gioia.aioe.org>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace individual.net sN+oASXejI9B7307piMxkA7zm65+FqgHKwdxu5wnLOSgPbqqT5
Cancel-Lock sha1:DbCxj1g+MGqvhQwqKaIgDUw89Wc=
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0
Content-Language en-CA
In-Reply-To <ssc2a3$1v7f$1@gioia.aioe.org>
Xref csiph.com comp.lang.php:18850

Show key headers only | View raw


On 2022-01-20 11:23, Mateusz Viste wrote:
> 
>> (There's nothing specific to PHP about that advice either.  It's
>> equally applicable to C, although modern C compilers _may_ make that
>> optimization for you.)
> 
> That's hardly applicable in C, since there is no "foreach" in C. There
> is a "for", and it's initialization argument is processed exactly once.

I was speaking more broadly about pulling invariant code out of any and
all loops regardless of where it appears in said loop, rather than
relying on the interpreter or compiler to handle it for you.

Back to comp.lang.php | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 15:16 +0100
  Re: poor performance while processing a file one byte a time John-Paul Stewart <jpstewart@personalprojects.net> - 2022-01-20 11:08 -0500
    Re: poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 17:23 +0100
      Re: poor performance while processing a file one byte a time John-Paul Stewart <jpstewart@personalprojects.net> - 2022-01-20 12:38 -0500
        Re: poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 19:49 +0100
    Re: poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 17:37 +0100
      Re: poor performance while processing a file one byte a time John-Paul Stewart <jpstewart@personalprojects.net> - 2022-01-20 12:41 -0500
        Re: poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 19:47 +0100
  Re: poor performance while processing a file one byte a time Arno Welzel <usenet@arnowelzel.de> - 2022-01-20 19:23 +0100
    Re: poor performance while processing a file one byte a time Mateusz Viste <mateusz@xyz.invalid> - 2022-01-20 19:45 +0100
      Re: poor performance while processing a file one byte a time Arno Welzel <usenet@arnowelzel.de> - 2022-01-20 20:27 +0100

csiph-web