Hacker News new | ask | show | jobs
by saagarjha 2268 days ago
> he could've thought that the simple implementation is faster but missed the fact that skip is implemented in assembly

It’s not; the compiler is just fairly decent at transforming string manipulation routines.

1 comments

>As Tim explained to me, first off, the reason why VB does this seemingly bizarre “find the first character match, then check if query is a prefix of source” logic is because the skipto method is not written in the naive fashion that I showed here. The skipto method is a single x86 machine instruction.

oh my bad then, from this text it sounded like it was written in assembly.