คำตอบ

Thanks everyone for your help, regardless! I was able to chip the time down to 00::00::00.070, which I'm alright
with. Not as fast as my C++ counterpart, but I'm pleased nevertheless. Thank you all for your help!

Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
"Mark as Answer" and "Vote as Helpful"
on posts that help you.
This can be beneficial to other community members reading the thread.

he hosting process is a feature in Visual Studio 2010 that improves debugging performance, enables partial trust debugging, and
enables design time expression evaluation. The hosting process files contain vshost in the file name and are placed in the output folder of your project. For more information, see Debugging
and the Hosting Process.

Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
"Mark as Answer" and "Vote as Helpful"
on posts that help you.
This can be beneficial to other community members reading the thread.

Testing with the Stopwatch class, the debug build runs at 00::00::00.042 on average. In the release build, it runs at 00::00::00.083
on average.

Does anyone know why this might be happening?

Try running this operation more than one time in the execution.

I suspect the problem, especially given the timings, is that, when you run it in release, the
first time your code runs, there will be some extra overhead as the JIT optimizes the code.

This is common - when you're doing timings with a stopwatch, it's always a good idea to run your code once, then start the stopwatch and run it a second time. Time the second (and subsequent) runs, as this will eliminate any JIT overhead.

Regards,
Ahmed Ibrahim
SQL Server Setup Team
This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
"Mark as Answer" and "Vote as Helpful"
on posts that help you.
This can be beneficial to other community members reading the thread.

Thanks everyone for your help, regardless! I was able to chip the time down to 00::00::00.070, which I'm alright
with. Not as fast as my C++ counterpart, but I'm pleased nevertheless. Thank you all for your help!