Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Basically yeah. At a super rough level of understanding, the CPU can compare two integers with one instruction, but has to loop through a whole string[1] one character at a time to compare two strings for equality.

[1] Yeah yeah, CPUs & standard libraries are smarter than that, I know, I know. You get the point.



Most String comparisons are <5 instructions




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: