Hacker News new | ask | show | jobs
by alkonaut 2618 days ago
The C# implementation looks flawed (uses reference types for vectors etc). Using value types and .NET Core should give a much better result than that. Will try to remember doing a PR.
2 comments

I've just tried out a bit with .NET Core 2.2.

Baseline of the non-multithreaded variant on my machine: 1m56s

Making Vector3 a struct: 1m3s

Making Vector3 a readonly struct: 1m1s

Making Hit and Ray a struct: 1m26s

Will test more tomorrow, I guess, but the most obvious change already yields a 2× speedup. This was also without any profiling, so I don't even know what I did there.

Tested this on the same machine with Ubuntu for Windows + old .NET Core 1.0. 3 min 20 seconds.