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


Groups > comp.lang.javascript > #39896

Re: Loop optimisation.

From The Natural Philosopher <tnp@invalid.invalid>
Newsgroups comp.lang.javascript
Subject Re: Loop optimisation.
Date 2021-04-11 11:34 +0100
Organization A little, after lunch
Message-ID <s4ujb9$h3l$2@dont-email.me> (permalink)
References <s4snvd$cr0$1@dont-email.me> <703ba9a5-2352-4cc4-af53-286453c47b1bn@googlegroups.com>

Show all headers | View raw


On 10/04/2021 21:36, Kristjan Robam wrote:
> Trying to optimize something ?
Sure.

Real time audio processing for ultimate use on a Pi running probably 
firefox.


> 
> 
> 
> 
> 
> Kristjan
> 
> The Natural Philosopher kirjutas laupäev, 10. aprill 2021 kl 20:41:08 UTC+3:
>> Does Js do it?
>>
>> I have some close to real time audio processing code and I want it to
>> run floating point on a raspberry Pi - no FP coprocessors so no wasted
>> cycles required.
>>
>> The question is - in C if you do something like
>>
>> function (int x)
>> for(somecondition)
>> if (x greater than whatever)
>> extra blah;
>> else completely different blah;
>> endfor
>>
>> will one hopes result in two completely different loops being
>> established so that conditionl is actually evaluated outside the loop -
>> i.e
>>
>> function (int x)
>> if (x greater than whatever)
>> for(somecondition)
>> extra blah;
>> endfor
>> else
>> for(somecondition)
>> completely different blah;
>> endfor
>> endif
>>
>> is what a decent compiler optimised for speed might well do.
>>
>> Does javascript though?
>>
>> And of course Javascript makes all numbers floating point...so the
>> comparison will be cycle hungry comparing two floats
>>
>>
>> -- 
>> Of what good are dead warriors? … Warriors are those who desire battle
>> more than peace. Those who seek battle despite peace. Those who thump
>> their spears on the ground and talk of honor. Those who leap high the
>> battle dance and dream of glory … The good of dead warriors, Mother, is
>> that they are dead.
>> Sheri S Tepper: The Awakeners.


-- 
Microsoft : the best reason to go to Linux that ever existed.

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


Thread

Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-10 18:41 +0100
  Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-10 19:14 +0100
    Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-11 11:33 +0100
      Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-11 15:03 +0100
        Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-11 07:38 -0700
          Re: Loop optimisation. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-04-11 13:36 -0700
          Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-12 18:05 +0100
            Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-12 23:16 +0100
              Re: Loop optimisation. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2021-04-13 05:19 -0700
                Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-13 06:21 -0700
        Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-12 01:36 +0100
          Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-12 18:04 +0100
            Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-12 23:09 +0100
              Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-13 20:08 +0100
                Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-13 21:41 +0100
                Re: Loop optimisation. John G Harris <niam@jghnorth.org.uk.invalid> - 2021-04-14 18:24 +0100
  Re: Loop optimisation. Kristjan Robam <he12457@hotmail.com> - 2021-04-10 13:36 -0700
    Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-11 11:34 +0100
  Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-10 22:22 -0700
    Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-11 11:36 +0100
    Re: Loop optimisation. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-04-14 02:20 +0200
      Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-14 06:48 -0700
        Re: Loop optimisation. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-04-14 17:31 +0200
          Re: Loop optimisation. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-04-14 18:00 +0200
            Re: Loop optimisation. The Natural Philosopher <tnp@invalid.invalid> - 2021-04-14 19:25 +0100
            Re: Loop optimisation. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-04-14 23:10 +0200
              Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-17 09:45 -0700
            Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-17 09:43 -0700
              Re: Loop optimisation. Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2021-04-17 21:45 +0200
                Re: Loop optimisation. Scott Sauyet <scott.sauyet@gmail.com> - 2021-04-18 19:06 -0700
          Re: Loop optimisation. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-04-17 08:50 -0700

csiph-web