Re:Benchmarking 20 programming languages on N-queens and mat...
by hgomersall on Wednesday January 03, 2024 @03:35AM
(#38851947)
Also it's using checked indexing, which apart from being not idiomatic, is also going to slow things down. A fairer comparison would be to use the unchecked indexing variants.
[ Parent
| on HN ]
Re:Benchmarking 20 programming languages on N-queens and mat...
by neonsunset on Wednesday January 03, 2024 @06:07AM
(#38852788)
Yeah, it's a similar problem in C# - ported code 1:1 is not representative since it now can't do out of bounds accesses and is therefore safe but comes at a cost of bounds checks which can be manually elided.
Re:Benchmarking 20 programming languages on N-queens and mat...
by vlovich123 on Wednesday January 03, 2024 @11:36AM
(#38856077)
Unchecked indexing is unidiomatic. A more fair comparison world be using iterators if possible but otherwise you have to live with that.