NerdLang / nerd

🔱 Javascript's God Mode. No VM. No Bytecode. No GC. Just native binaries.
https://nectarjs.com
MIT License
3.58k stars 127 forks source link

Executables very slow on Debian 12? #159

Open mavavilj opened 9 months ago

mavavilj commented 9 months ago

I am testing the Fibonacci code. As an example I am finding the 41st number.

fibo.zip

node fibo.js returns pretty quickly, but ./fibo.out after

nectar fibo.js -o fibo.out

takes noticeably long to return.

This is entirely different what's supposed to happen based on the benchmarks in the repository.

Is something broken?

mavavilj commented 9 months ago

OTOH, the loop at:

https://github.com/NerdLang/nerd/issues/68

runs about 7x faster with nectar than node.

mavavilj commented 9 months ago

Other test code at e.g.:

https://github.com/drujensen/fib

time node fib.js 2971215073

real 0m40.203s user 0m40.191s sys 0m0.012s

nectar fib.js -o fibnectar

time ./fibnectar 2.97122e+09

real 7m55.692s user 7m55.680s sys 0m0.000s

adrien-thierry commented 9 months ago

Hi,

which compiler are you using ?

mavavilj commented 9 months ago

gcc --version gcc (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

g++ --version g++ (Debian 12.2.0-14) 12.2.0 Copyright (C) 2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

adrien-thierry commented 9 months ago

it should not be so slow, quite strange

mavavilj commented 9 months ago

Problem persists even after reinstalling a fresh Debian 12.

Likely specific to the OS or a particular version of the OS or some packages?

Any other OSes to try?

OTOH, since Node seems to work flawlessly, then maybe it's just nectar?

There's no difference when building with:

node nectar fib.js -o fibnectarman