Remix.run Logo
mrsmrtss 3 days ago

Of these languages, C# may actually be the fastest.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

tialaramex 3 days ago | parent [-]

In most cases the later entries in a language for the benchmark game are increasingly hyper-optimized and non-idiomatic for that language, which is exactly where C# will say "Here's some dangerous features, be careful" and the other languages are likely to suggest you use a bare metal language instead.

Presumably the benchmark game doesn't allow "I wrote this code in C" as a Python submission, but it would allow unsafe C# tricks ?

igouy 2 days ago | parent | next [-]

Note: 'possible hand-written vector instructions or "unsafe" or naked ffi' are flagged by *

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Note: Here are naive un-optimised single-thread programs transliterated line-by-line literal style into different programming languages from the same original.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

mrsmrtss 2 days ago | parent | prev [-]

Unsafe C# is still C# though. Also C# has a lot more control over memory than Java for example, so you don't actually need to use unsafe to be fast. Or are you trying to say that C# is only fast when using unsafe?

jamincan 2 days ago | parent [-]

Likely just that the fastest implementations in the benchmarks game are using those features and so aren't really a good reflection of the language as it is normally used. This is a problem for any language on the list, really; the fastest implementations are probably not going to reflect idiomatic coding practices.

igouy 2 days ago | parent | next [-]

Here are naive un-optimised single-thread programs transliterated line-by-line literal style into different programming languages from the same original.

https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

neonsunset 2 days ago | parent | prev [-]

[dead]