Hanselminutes with Scott Hanselman cover image

All the Performance with RavenDB's Oren Eini

Hanselminutes with Scott Hanselman

00:00

How to Optimize String Work to a Tight Loop

When we think of low level string work, which is not low level, it's string.index of. So when that gets optimized all the way down into the silicon, we enroll and then you're in the middle of multiple for loops or something like that. But now you optimize that to a tight loop that is maybe 10, 15 instructions using a dedicated assembly command just for that particular scenario. And suddenly the code is much more efficient, but then you have another impact. It's much smaller, so it has better inline kit, so it's able to inline the method. Now, what's the cost of a method called? Well, you have to save the registers, do a

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app