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


Groups > comp.lang.javascript > #39565

Re: Picture colors decreasing script.

Path csiph.com!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Picture colors decreasing script.
Date Thu, 04 Mar 2021 02:07:30 +0000
Organization A noiseless patient Spider
Lines 22
Message-ID <87o8fzoen1.fsf@bsb.me.uk> (permalink)
References <7fbf64ec-ed11-4ee7-b530-459e5681651en@googlegroups.com> <91fc5c33-11cc-480d-8703-272e7d161849n@googlegroups.com> <5440012.DvuYhMxLoT@PointedEars.de> <52708860-8e17-4136-b79d-f76002425ce2n@googlegroups.com> <5689266.lOV4Wx5bFT@PointedEars.de> <ae17e712-ed89-4b7c-9a6e-c4d2d224bbb2n@googlegroups.com> <2188480.ElGaqSPkdT@PointedEars.de> <663d9d05-08a6-4593-883e-0b68f64a2c93n@googlegroups.com> <1775923.tdWV9SEqCh@PointedEars.de> <432d6208-3469-4b90-b378-536582e46760n@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain
Injection-Info reader02.eternal-september.org; posting-host="2073490acaf878b993fe043248dd94f5"; logging-data="17953"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19B9OT6oipqo5rfrGNNFJP7NEtazZjRolo="
Cancel-Lock sha1:T9dcA1Md/W/yXIFWbBIPTd8sg3o= sha1:dsovggptAQw0C1xBuhGZKZtrds8=
X-BSB-Auth 1.2f830d0fee57c032f1bf.20210304020730GMT.87o8fzoen1.fsf@bsb.me.uk
Xref csiph.com comp.lang.javascript:39565

Show key headers only | View raw


"Michael Haufe (TNO)" <tno@thenewobjective.com> writes:

> On Wednesday, March 3, 2021 at 2:53:26 PM UTC-6, Thomas 'PointedEars' Lahn wrote:
>> Michael Haufe (TNO) wrote: 
>> > <https://jsbench.me/ulkltk1xpk>
>> Fascinating; slicing is 93.08 % slower than direct access. But why?
>
> Given the steps slice takes, this should not be surprising:
>
> <https://tc39.es/ecma262/#sec-array.prototype.slice>
>
> Direct access is O(1)
>
> `slice` is O(N) where N is end - start

Isn't that O(1) for the case in question?  (Big O might be too crude a
measure for this.)

> Thus an order of magnitude worse.

-- 
Ben.

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Picture colors decreasing script. Kristjan Robam <kristjanrobam01@mail.ee> - 2021-02-28 22:33 -0800
  Re: Picture colors decreasing script. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-01 11:56 -0800
    Re: Picture colors decreasing script. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-02 13:42 +0100
      Re: Picture colors decreasing script. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-03 07:02 -0800
        Re: Picture colors decreasing script. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-03 19:47 +0100
          Re: Picture colors decreasing script. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-03 11:37 -0800
            Re: Picture colors decreasing script. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-03 21:33 +0100
              Re: Picture colors decreasing script. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-03 12:38 -0800
                Re: Picture colors decreasing script. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-03-03 21:53 +0100
                Re: Picture colors decreasing script. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-03-03 16:36 -0800
                Re: Picture colors decreasing script. Ben Bacarisse <ben.usenet@bsb.me.uk> - 2021-03-04 02:07 +0000
          Re: Picture colors decreasing script. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-03-04 09:40 +0000

csiph-web