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


Groups > comp.lang.javascript > #29292

Re: Memory allocation overflow

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Memory allocation overflow
Date 2016-01-17 20:15 +0000
Organization A noiseless patient Spider
Message-ID <878u3odktt.fsf@bsb.me.uk> (permalink)
References (6 earlier) <569aa72a$0$23819$e4fe514c@news.xs4all.nl> <569aa8a2$0$23819$e4fe514c@news.xs4all.nl> <648d8d6b-e296-4b52-96e5-8c66e1cb06be@googlegroups.com> <3gtm9b9u37e7viv4rvs94cjf49ae9v22nk@4ax.com> <caca3674-66d1-43ad-a079-9b75f41267b0@googlegroups.com>

Show all headers | View raw


jonas.thornvall@gmail.com writes:

> Den söndag 17 januari 2016 kl. 12:08:48 UTC+1 skrev John Harris:
>> On Sat, 16 Jan 2016 14:06:18 -0800 (PST), jonas.thornvall@gmail.com
>> wrote:
>> 
>>   <snip>
>> >Oh my gosh a monkey doing a parrots job, this must be the shittiest NG
>> >in the galayx. Jast saw star wars.
>> >
>> >Oh no monkey leave the job to the parrots at least they have the
>> >mindset to bring up some heat on the issue, that make me debug the
>> >code myself.
>> >
>> >But it is so fucking weird that people in this NG are in total refusal
>> >to reveal any bug they spot. They just want general questions that
>> >they can answer with a yes or no.
>>   <snip>
>> 
>> There speaks someone who expects people to spend an hour on messy code
>> and work out for themselves what each function should do.
>> 
>> By the way, shouldn't factor_it return false when i/j is an integer,
>> not true the first time it isn't?
>> 
>> And wouldn't it be simpler to see if the remainder, i%j, is zero?
>> 
>
> I think i did read isInteger is faster.

Did you test it?  On at least one system, I found that a version of your
function with % rather than / and isInteger was 4 times faster.  (And
you get another factor of 2 by not testing division by all even numbers.
You'll get even more speed if you use a prime sieve.)

<snip>
-- 
Ben.

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


Thread

Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 09:58 -0800
  Re: Memory allocation overflow "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-16 19:52 +0100
    Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 11:03 -0800
      Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 11:05 -0800
        Re: Memory allocation overflow Luuk <luuk@invalid.lan> - 2016-01-16 20:13 +0100
          Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 11:25 -0800
            Re: Memory allocation overflow Luuk <luuk@invalid.lan> - 2016-01-16 21:25 +0100
              Re: Memory allocation overflow Luuk <luuk@invalid.lan> - 2016-01-16 21:31 +0100
                Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 14:06 -0800
                Re: Memory allocation overflow John Harris <niam@jghnorth.org.uk.invalid> - 2016-01-17 11:08 +0000
                Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-17 04:10 -0800
                Re: Memory allocation overflow Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-17 20:15 +0000
                Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-17 13:25 -0800
                Re: Memory allocation overflow Carlos Pedro <carlospedr@gmail.com> - 2016-01-18 08:21 -0800
      Re: Memory allocation overflow "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2016-01-16 20:29 +0100
  Re: Memory allocation overflow Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-16 23:43 +0000
    Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 19:30 -0800
      Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 19:56 -0800
        Re: Memory allocation overflow jonas.thornvall@gmail.com - 2016-01-16 20:01 -0800
  Re: Memory allocation overflow Silvio <silvio@internet.com> - 2016-01-18 16:09 +0100

csiph-web