kevin-montrose / Sigil

A fail-fast validating helper for .NET CIL generation
Microsoft Public License
988 stars 92 forks source link

Binary searched length cache and no superfluous cache clearing. #47

Open n8allan opened 7 years ago

n8allan commented 7 years ago

LengthTo showed up as the main hot-spot on profiles of large method emissions. The replaced implementation would always start at the beginning in the event of a miss (even though length determination might have been done through a higher offset, and the cache was being cleared even in the most common event of a simply appended instruction.