Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.javascript Subject: Re: Memory allocation overflow Date: Sun, 17 Jan 2016 20:15:10 +0000 Organization: A noiseless patient Spider Lines: 38 Message-ID: <878u3odktt.fsf@bsb.me.uk> References: <4eb1912d-87cd-4e4b-a4b0-5154de752831@googlegroups.com> <6eb593a1-95cd-446f-aa0f-d15a2593ad38@googlegroups.com> <569a963f$0$23842$e4fe514c@news.xs4all.nl> <569aa72a$0$23819$e4fe514c@news.xs4all.nl> <569aa8a2$0$23819$e4fe514c@news.xs4all.nl> <648d8d6b-e296-4b52-96e5-8c66e1cb06be@googlegroups.com> <3gtm9b9u37e7viv4rvs94cjf49ae9v22nk@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="14916"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18CpLL9daqeA3iYXAsGyqI7oJKPy63N3mU=" Cancel-Lock: sha1:+VWSAPmEuHaTsmMZ3K9HCLv97Xk= sha1:4H95+bp8AqS1UuJkCaT+s/47nlE= X-BSB-Auth: 1.77024d3423782a750b77.20160117201510GMT.878u3odktt.fsf@bsb.me.uk Xref: csiph.com comp.lang.javascript:29292 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: >> >> >> >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. >> >> >> 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.) -- Ben.