2 ms·
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 ch
by coldpie 4y ago
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.
- saagarjha 4y agoMost String comparisons are <5 instructions