|
-
Mar 23rd, 2023, 06:39 PM
#36
Re: VB6 0xc0000005 on Windows 11 after calling *any* API
 Originally Posted by PlausiblyDamp
@niya - not had chance to try this but I wonder if using a Span<int> instead of pointers would make any difference to performance.
In this particular case, I could not find a clean way to use a Span<int> that would have been beneficial. I used pointers so I could benefit from directly utilizing the Avx2 VMOVDQU instruction via the LoadVector256 function. This allows me to copy from the array to a vector register in a single instruction. This is the most direct way of doing it and any other way would add extra overhead.
Spans are very powerful performance enhancers when used correctly but when it comes to the Avx intrinsics, you wouldn't find much room for them. Many of these Avx functions in C# are mapped directly to Avx2 instructions in native code by the RyuJIT so it's lower level than Spans. A lot of these instructions take memory addresses as operands so you will be dealing with pointers quite a bit.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|