Comment

Comment by johaugum

On index benchmark results:

>Still not quite as fast as Go, but it's close. Honestly, I don't know why the memchr-based implementation is still slower than Go's assembly here, but I decided not to pursue it any further.

Libc call overhead. Your version is using an already-fast memchr, but it still has to cross a general libc boundary and then do the pointer/index around it.

Index with a 1-byte needle collapses to IndexByte, and on arm64 that goes into Go asm.

parent johaugum 7 months ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton