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


Groups > comp.lang.javascript > #29227

Re: Improve speed calculations?

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.javascript
Subject Re: Improve speed calculations?
Date 2016-01-11 13:28 +0000
Organization A noiseless patient Spider
Message-ID <87si24w8id.fsf@bsb.me.uk> (permalink)
References <86bb6f49-d74d-426d-bc2a-5b4cd7199bf4@googlegroups.com> <69c96cdd-1020-470c-b0b2-66e2898468bb@googlegroups.com>

Show all headers | View raw


jonas.thornvall@gmail.com writes:

> Den söndag 10 januari 2016 kl. 14:33:27 UTC+1 skrev jonas.t...@gmail.com:
>> <script language="Javascript">
<snip code>
> http://jt.node365.se/BAUTABASE.html
>
> Using the biggest base possible adding "4503599627370495" encoding
> fibonacci in javascript without overflow.
>
> Also fixed ambiguity reading out the numbers in bases over ten by
> using separator for digitplaces. The add can not cause overflow but to
> get rid of base overflow would require some real deep thinking.
>
> The 100000th Fibonacci took 34 seconds i do not think i can get it
> much faster in javascript if your a wizard please prove me wrong.

I have not tried your code, but I've just written a quick bignum add
function and I can get fib(100000) in about 3.5 seconds.  If I have time
to unravel yours, I'll do a comparative test.  Note that a language with
a good bignum type (Haskell, for example) will do it in less than 100th
of a second.

Note that your 'challenge' makes it easy to optimise the code.  For
example, using a power of 10 as the base makes the conversion for
printing very simple.

-- 
Ben.

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


Thread

Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-10 05:33 -0800
  Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 03:19 -0800
    Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 04:41 -0800
    Re: Improve speed calculations? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-11 13:28 +0000
      Re: Improve speed calculations? Silvio <silvio@internet.com> - 2016-01-11 15:41 +0100
        Re: Improve speed calculations? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-01-11 15:44 +0000
          Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 07:53 -0800
          Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 07:56 -0800
          Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 08:28 -0800
      Re: Improve speed calculations? jonas.thornvall@gmail.com - 2016-01-11 06:48 -0800

csiph-web