Imaginary Game Engine » Imaginary Game Engine » Optimized math experiments
I've been on a very nice holiday, so it's been a bit quiet around here. But last week, while surfing around the net, I found something very interesting: NetAsm. NetAsm is a library that allows you to inject precompiled native code into a managed method at runtime. It's still very new and only works on 32 bit Windows, but has great potential.
So what can it do for IGE, you'd ask?
Well, I've been experimenting before with a C++/CLI library with SSE optimized math functions, to speed up our matrix calculations a bit. Unfortunatley the interop required between managed and unmanaged code almost completely cancels the performance gain from using the special SSE instructions. NetAsm however, injects your precompiled code as managed code, avoiding the costly interop. This only works for simple, self-containing functions, but it's good enough for some optimized math routines, as you can see from my experiments below:
Although I haven't spend much time optimizing the C# math routines yet, the performance gain amazed me. So when IGE gets a bit more stable, I'll probably create an optimized math extension using NetAsm.
You can't post comments until you have logged in. Please login by clicking here.
No one has commented on this page yet.
RSS feed for comments on this page | RSS feed for all comments