News for hackers. Stuff that matters.
Re:Dart team posts an example of fast code with 22ms for a “... by dzhiurgis on Thursday May 07, 2020 @04:17PM (#23107742)
How it compares with go, node and java?
Re:Dart team posts an example of fast code with 22ms for a “... by timsneath on Thursday May 07, 2020 @05:08PM (#23108354)
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

  $ hyperfine 'java HelloWorld' --warmup 10
  Benchmark #1: java HelloWorld
    Time (mean ± σ):      90.7 ms ±   1.3 ms   [User: 83.2 ms, 
      System: 23.9 ms]
    Range (min … max):    88.7 ms …  94.2 ms   31 runs
Re:Dart team posts an example of fast code with 22ms for a “... by vips7L on Thursday May 07, 2020 @06:42PM (#23109222)
Which JDK? OpenJDK 14 on my machine:

    ~> Measure-Command { java Main }
    Milliseconds      : 59
Re:Dart team posts an example of fast code with 22ms for a “... by Delk on Saturday May 09, 2020 @12:42PM (#23126191)
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 “... by vips7L on Monday May 11, 2020 @09:54PM (#23149742)
Nice! I'm glad startup time is getting closer to python. FWIW GraalVM native image was 16ms for me on Windows.
Re:Dart team posts an example of fast code with 22ms for a “... by vips7L on Thursday May 07, 2020 @06:55PM (#23109340)
Also with GraalVM Native:

   ~> .\native-image.cmd --static Main Main
   ~> Measure-Command { ./Main }
   Milliseconds      : 16