Live data from Hacker News

The One Billion Row Challenge

morling.dev

321–330 of 366 posts

Re: The One Billion Row Challenge

#321
post #310
post #291

Earlier quoted context omitted.

It has always been “an imperative code that outputs the declarative configuration that can be used for the build”. Which is a very reasonable thing to do, but unfortunately most people fail to understand that a println in the config file’s global scope is different than inside a closure for a task description.

> but unfortunately most people fail to understand that a println in the config file’s global scope is different than inside a closure for a task description. Literally no one complaining about gradle being slow is doing that. Allmost all of gradle's problems come not from people using it, but from Gradle itself. I mean, you said it yourself: in 15 years the state of their API docs is "okayish". But somehow people ar…

So what other general purpose build tool do you recommend/vouch for?

I actually really like Mill, but it is very small still. I’m unaware of too many playing in the same categories as Gradle.

Re: The One Billion Row Challenge

#322
post #307

Earlier quoted context omitted.

have you worked with any compiled languages? It's not much different. It can get a lot worse ^_^. Java's one of the best languages to work in IMO.

I work professionally in C++, but I wouldn’t tout it either. I find Python to be the most pleasant personally.

Python with types is indeed great.

Re: The One Billion Row Challenge

#323

Earlier quoted context omitted.

I profiled my attempt, actually reading each line is the bottleneck.

Perl is always going to be much faster than Java at tasks like this. Use stdin and chomp() instead of reading each line explicitly. This is really a small, trivial task for a perl script. Even with a billion lines this is nothing for a modern cpu and perl.

/r/perl would beg to differ:

https://www.reddit.com/r/perl/comments/18ygpsi/1_billion_row...

Re: The One Billion Row Challenge

#325
Here's my implementation in Go, which runs in under 5 seconds. It doesn't use anything too obscure, only the built-in maps and no external libraries. It's also the fastest solution I've tested on my M3 Pro Mac. Eager to see what beats it!

https://gist.github.com/corlinp/176a97c58099bca36bcd5679e68f...

Re: The One Billion Row Challenge

#326

Earlier quoted context omitted.

> No external dependencies may be used

the whole premise is silly though. why would anyone use plain java to compute this when databases were built for this or at least are the most finely tuned for it

It's only silly if you miss the point of the challenge :) Which is to learn something new and have fun along the way.

Re: The One Billion Row Challenge

#327
post #159
post #75

Earlier quoted context omitted.

What step are we talking about? Javac itself is absolutely on the same order of magnitude speed as Go per loc, while rust is significantly slower (which makes sense, the latter is a properly optimizing compiler with heavy static analysis, while the former two just spews out java byte code/machine code). Gradle with a daemon is also pretty fast, you are just probably used to some complex project with hundreds of depen…

> Gradle with a daemon is also pretty fast I've yet to see a project where Gradle daemon a) does anything useful and b) is acutally used by gradle itself (instead of seemingly doing everything from scratch, no idea what it does in the seconds it takes for it to start up).

>I've yet to see a project where Gradle daemon a) does anything useful

Also my experience.

Only using Gradle deamon does not help making a multi-project setup much faster. You also have to enable build cache, configuration cache and configure on demand with `--configuration-cache --configure-on-demand` and hope nobody in the project breaks the ability for Gradle to use these caches. But then it still took at least 10 seconds to build and start my services (and that's with incremental builds, like you changed one line of code after the first slow build). I spend two days and more after release to speed this stuff up, before it was 30 seconds sometimes 60 seconds.

And the protobuf Gradle plugin sometimes did not update the generated code, so you had force-delete the files on every build. And then other stuff in the caches broke and you had to delete `.gradle` directory and sometimes even the `~/.gradle` directory. And sometimes the Gralde daemon hangs so you have to force it to stop with `--stop.

Go build, deno and bun are so much more reliable and faster. Something that was surprisingly fast was using the Gradle setup with skaffolding. Java hot code swapping is very fast.

Re: The One Billion Row Challenge

#328

Here's my implementation in Go, which runs in under 5 seconds. It doesn't use anything too obscure, only the built-in maps and no external libraries. It's also the fastest solution I've tested on my M3 Pro Mac. Eager to see what beats it! https://gist.github.com/corlinp/176a97c58099bca36bcd5679e68f...

Look at the leaderboard for the fastest solutions

https://github.com/gunnarmorling/1brc#results

The fastest is currently at 12 seconds (not on M3 Pro though).

Re: The One Billion Row Challenge

#329
post #13

> Each contender will be run five times in a row. The slowest and the fastest runs are discarded. The mean value of the remaining three runs is the result for that contender and will be added to the leaderboard. Shouldn’t he take the single fastest time, assuming file (and JDK) being in file cache is controlled for?

This is done to simulate real-world performance. Your binary is not the only binary in the system and other services may be running as well. So fastest time is the happiest path and slowest is the unluckiest. The range of remaining three is what you expect to get 99% of the time on a real world system.

But this is a contrived test, and looking for the fastest solution, so your arguments point to taking the fastest: the one with the least interference.

Re: The One Billion Row Challenge

#330

This is an IO bound problem. Trying to "go faster" by using multiple threads or vectorisation isn't going to achieve much.

I'm pretty sure Hetzner servers (where the test is performed) have NVMe drives that can read at 4GB/s. So theoretically IO bound solution would be done in around 0.25 seconds. However the fastest current solution is around 12 seconds.

So it's not IO-bound.

Post reply on HN