Live data from Hacker News

Dart team posts an example of fast code with 22ms for a “Hello world”

twitter.com

31–33 of 33 posts

Re: Dart team posts an example of fast code with 22ms for a “Hello world”

#31
post #30

Earlier quoted context omitted.

The text on the page is "AOT-compile apps to native machine code for instant startup". And now you're saying that the start up is actually not instant. - LuaJIT: 0.002ms [1] - Dash and perl take about 2ms. Python takes 12. [2] - Perl 0.008s [3] - Python 0.009s [4] And that's before we talk about compilation speeds [5] [1] https://news.ycombinator.com/item?id=23109404 [2] https://news.ycombinator.com/item?id=23110092…

"Instant" is a relative word (unless we're actually at 0 time :-)). We're focus on client apps, where we're really focused on human perception. In that sense, I'd consider 22ms or 2ms as instant (for startup). I wouldn't consider 2s as instant. I'm not saying Dart doesn't have room to get better, but there are diminishing returns at a certain point.

22ms here. 22ms there. "Focused on human perception" here, "Focused on human perception" there.

And suddenly we have what is basically a supercomputer unable to perform anything without lag.

Re: Dart team posts an example of fast code with 22ms for a “Hello world”

#32
post #21

Earlier quoted context omitted.

Here are a few comparisons (13" MBP, YMMV). $ ./hyperfine './hello.gonative' --warmup 10 Benchmark #1: ./hello.gonative Time (mean ± σ): 3.3 ms ± 0.9 ms [User: 1.2 ms, System: 1.2 ms] Range (min … max): 2.4 ms … 14.2 ms 455 runs $ ./hyperfine './hello.dartnative' --warmup 10 Benchmark #1: ./hello.dartnative Time (mean ± σ): 8.2 ms ± 0.4 ms [User: 3.9 ms, System: 3.6 ms] Range (min … max): 7.5 ms … 10.2 ms 243 runs $…

Which JDK? OpenJDK 14 on my machine: ~> Measure-Command { java Main } Milliseconds : 59

I got:

OpenJDK 8: ~80-90 ms

OpenJDK 11: ~60 ms

OpenJDK 14: ~50-55 ms

The first runs were a bit slower, perhaps because the files needed by the JVM weren't in disk cache or something.

Other languages/runtimes:

Python 2.7: 20-25 ms

Python 3.8: 30-40 ms

Native binary compiled from C: 1-3 ms (so bordering on unmeasurable at millisecond resolution)

This was on Linux, and an entirely unrigorous experiment.

edit: formatting

Re: Dart team posts an example of fast code with 22ms for a “Hello world”

#33
post #32
post #21

Earlier quoted context omitted.

Which JDK? OpenJDK 14 on my machine: ~> Measure-Command { java Main } Milliseconds : 59

I got: OpenJDK 8: ~80-90 ms OpenJDK 11: ~60 ms OpenJDK 14: ~50-55 ms The first runs were a bit slower, perhaps because the files needed by the JVM weren't in disk cache or something. Other languages/runtimes: Python 2.7: 20-25 ms Python 3.8: 30-40 ms Native binary compiled from C: 1-3 ms (so bordering on unmeasurable at millisecond resolution) This was on Linux, and an entirely unrigorous experiment. edit: formatting

Nice! I'm glad startup time is getting closer to python. FWIW GraalVM native image was 16ms for me on Windows.
Post reply on HN