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


Groups > comp.lang.javascript > #29233

Re: Improve speed calculations?

X-Received by 10.182.255.203 with SMTP id as11mr119333291obd.49.1452529731569; Mon, 11 Jan 2016 08:28:51 -0800 (PST)
X-Received by 10.50.225.101 with SMTP id rj5mr266363igc.3.1452529731548; Mon, 11 Jan 2016 08:28:51 -0800 (PST)
Path csiph.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!news.glorb.com!h5no3048180igh.0!news-out.google.com!kr2ni2081igb.0!nntp.google.com!h5no3048173igh.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups comp.lang.javascript
Date Mon, 11 Jan 2016 08:28:51 -0800 (PST)
In-Reply-To <87fuy4w27e.fsf@bsb.me.uk>
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=85.229.217.28; posting-account=kxPkPAoAAACjJi8w0gL9bnyznPzdw9HW
NNTP-Posting-Host 85.229.217.28
References <86bb6f49-d74d-426d-bc2a-5b4cd7199bf4@googlegroups.com> <69c96cdd-1020-470c-b0b2-66e2898468bb@googlegroups.com> <87si24w8id.fsf@bsb.me.uk> <5693bf11$0$23861$e4fe514c@news.xs4all.nl> <87fuy4w27e.fsf@bsb.me.uk>
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <ea93fc95-7ec2-4827-9f23-9beda487a7bb@googlegroups.com> (permalink)
Subject Re: Improve speed calculations?
From jonas.thornvall@gmail.com
Injection-Date Mon, 11 Jan 2016 16:28:51 +0000
Content-Type text/plain; charset=ISO-8859-1
Content-Transfer-Encoding quoted-printable
Xref csiph.com comp.lang.javascript:29233

Show key headers only | View raw


Den måndag 11 januari 2016 kl. 16:44:32 UTC+1 skrev Ben Bacarisse:
> Silvio <silvio@internet.com> writes:
> 
> > On 01/11/2016 02:28 PM, Ben Bacarisse wrote:
> >> 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.
> >>
> >
> > That is well neigh impossible if you used a 10-based decimal since
> > Jonas uses a huge base and is convinced that using a larger base will
> > make computations much faster. Your result would invalidate that
> > claim...
> 
> Using base 10 is quite slow (my code needs 23s for fib(100000) using
> base 10), but I use a higher power of 10 as the base for speed whilst
> keeping printing simple.  With higher powers, you do get faster results
> (up to a limit, of course!).
> 
> -- 
> Ben.

How about using "a real bignumb library" and binary, what will happen?

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