mcserep/NetOctree

Plans to use System.Numerics

JardarM opened this issue · 3 comments

Hi,

do you have plans to make use of System.Numerics (that supports SIMD opperations) for Points? To my knowledge the System.Numerics should deliver very good performance.

I had a go at using System.Numerics and got pretty significant speedup.
Testing 1.000.000 rays with an octree with 1000 objects.

Orignial code:
Time org: 00:00:24.5173687
rays/ms org: #40.78741125266024

Code as is, but using System.Numerics
Time old: 00:00:19.1715894
rays/ms old: #52.160516227204404

Optimized code (more vector operations)
Time new: 00:00:10.9149289
rays/ms new: #91.61763756427217

I did a fork with example code.

Hello @JardarM ,
Sorry for the long response time, I had little time for this project in the past few months. Your results look really promising, it could worth updating the requirements to .NET Standard 2.1. Could you submit a pull request based on your implementation?

Updated codebase to use System.Numerics.Vector3 instead of the custom Point type in v1.1.0 (see ace84b2). Target framework had to be updated to .NET Standard 2.1 and .NET Framework 4.6, so System.Numerics is available.