top | item 38863668

(no title)

lessbergstein | 2 years ago

I don't understand, it should be pretty easy. A rolling average with BigDecimal would probably be sufficient but a scientific lib might be better for a rolling average or more than a hundred million numbers.

https://stackoverflow.com/questions/277309/java-floating-poi...

discuss

order

ako|2 years ago

The difficulty is creating the fastest implementation. If you look at the results of the submissions so far you’ll see a big difference in duration, between 11 seconds and more than 4 minutes.

11 seconds seems pretty impressive for a 12Gb file. Would be interesting to know what programming language could do it faster. For a database comparison you’d probably want to include loading the data into your database for a fair comparrison.

lessbergstein|2 years ago

Perl would do it quite fast and it has the benefit of accessing posix primitives directly.

petters|2 years ago

It’s easy to solve but even fizzbuzz becomes complicated if you want double digit GB/s output.

lessbergstein|2 years ago

It's really not. We're talking about gigahertz CPUs and likely solid state storage that can stream many gb/s.. running through a perl script. There really isn't much that is faster than that.