Live data from Hacker News

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

twitter.com

1–10 of 33 posts

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

#3
Wait, that's like 4.4*10^7 clock cycles for my laptop!

Here's hello.sh (in bash) on a Raspberry Pi 3B+:

  #!/bin/bash
  echo "Hello World!"



  xxxxx@xxxxxxx:~ $ time ./hello.sh
  Hello World!

  real    0m0.010s
  user    0m0.001s
  sys     0m0.010s

Yay, I beat the high score!

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

#6
post #5

It's a startup time of the runtime. More interested in results with two "hello,world"s. How much the next one going to cost. Also C++ with cout, -O3 is 4ms and one in *.Zig is 1ms for some reason.

Probably want -Os (and strip afterwards) if you're interested in startup time. C is also 1ms. C++ has a big cxxrt that zig doesn't. FWIW c++ only takes 2ms on my (quite slow) machine.

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

#10
post #5

It's a startup time of the runtime. More interested in results with two "hello,world"s. How much the next one going to cost. Also C++ with cout, -O3 is 4ms and one in *.Zig is 1ms for some reason.

Probably want -Os (and strip afterwards) if you're interested in startup time. C is also 1ms. C++ has a big cxxrt that zig doesn't. FWIW c++ only takes 2ms on my (quite slow) machine.

would ios_base::sync_with_stdio(false); also help?
Post reply on HN