Hand coded Javascript v C speed

Discussion of chess software programming and technical issues.

Moderators: hgm, Rebel, chrisw

op12no2
Posts: 496
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Hand coded Javascript v C speed

Post by op12no2 »

Just a little experiment to get an idea of the speed difference between a hand-coded Javascript chess engine running in Node (Google V8 Javascript engine) v C. About x 3 to 4 for C.

https://github.com/op12no2/clozza

I'll see how much faster I can make the C version now.
leothetechguy
Posts: 4
Joined: Mon May 20, 2024 10:45 am
Full name: Leo Fruijtier

Re: Hand coded Javascript v C speed

Post by leothetechguy »

I'd love to see the javascript engine run in bun, it's compatible with node.js code and much faster: https://bun.sh/
op12no2
Posts: 496
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: Hand coded Javascript v C speed

Post by op12no2 »

leothetechguy wrote: Wed May 29, 2024 10:27 am I'd love to see the javascript engine run in bun, it's compatible with node.js code and much faster: https://bun.sh/
Interesting, I'll try it. I think CCRL use Node but if bun is significantly faster it'd be a nice bump for the Javascript engines.
op12no2
Posts: 496
Joined: Tue Feb 04, 2014 12:25 pm
Full name: Colin Jenkins

Re: Hand coded Javascript v C speed

Post by op12no2 »

Slightly faster:-

Code: Select all

xyzzy@work:~$ bun clozza.js bench q
26.6 sec 51786380 nodes

xyzzy@work:~$ node clozza.js bench q
29.3 sec 51786380 nodes
I'll try a match...