Skip to main content
13 events
when toggle format what by license comment
Dec 5, 2018 at 16:27 comment added a06e @Szabolcs In Julia it is also easy to memoize (you need a package, github.com/JuliaCollections/Memoize.jl). It could be interesting to compare memoized implementations.
Mar 3, 2017 at 17:22 comment added warren never understood why Fibonacci code (like factorials) are always expressed recursively when linearly implementing the algorithm is pretty simple and straightforward
May 20, 2016 at 17:50 history edited Karsten7
edited tags
Jan 10, 2015 at 23:35 answer added MBryn timeline score: 14
Jul 28, 2014 at 12:47 history tweeted twitter.com/#!/StackMma/status/493739576943710208
Jun 16, 2014 at 20:13 comment added Szabolcs It's possible to do memoization in other languages too, it just takes (a lot?) more work. Since this benchmark is primarily meant to compare speed (not how easy the language is to use), it wouldn't be fair to use the memoized Fibonacci code ...
Jun 16, 2014 at 20:12 comment added Szabolcs I did look at this code the other day. It is not all idiomatic Mathematica. Compile is in particular overused. But it does run very fast. It looks like whoever wrote it put in considerable effort to make it run fast. This is not unidiomatic because the programmer didn't know Mathematica well. It's like that because it's optimized for speed. It is definitely an advantage of Mathematica that memoization is easy, and the Fibonacci implementation you show is indeed the most idiomatic fast implementation. The problem is that the algorithm it uses differs from the code in other languages.
Jun 9, 2014 at 17:13 comment added Szabolcs It looks like everything is using Compile. I wouldn't write code like this for the benchmark. Even if in some cases the compiled code is faster, it is not natural for Mathematica. I'd only use Compile in cases when it's clearly the best approach, e.g. the mandelbrot test. I did write a set of Mathematica benchmarks when Julia was first made public, but I got lazy at the quicksort and stopped there. I hacve the rest, should dig them up.
Jun 9, 2014 at 15:45 comment added Daniel Lichtblau One could interpret this as a question along the lines "Do people have input on better Mathematica coding of examples in ...?"
Jun 9, 2014 at 12:53 comment added Ajasja What exactly is the question? This is a Q&A site after all...
Jun 9, 2014 at 8:19 comment added dr.blochwave For the Fibonacci example, this might be related: mathematica.stackexchange.com/questions/31593/…
Jun 9, 2014 at 7:46 comment added Yves Klett You know that self-answering is not at all frowned upon? ;-)
Jun 9, 2014 at 4:15 history asked TheDoctor CC BY-SA 3.0