4 ms·
All modern CPU architectures have builtin fast string compare instructions. Here is a table from the Intel manual (bolded are the relevant compare instructions
by hummus_bae 4y ago
All modern CPU architectures have builtin fast string compare instructions.
Here is a table from the Intel manual (bolded are the relevant compare instructions):
https://msdk.intel.com/en-us/library/cc286809.aspx https://msdk.intel.com/en-us/library/cc286809.aspx
> SSE-4.2: Compare strings using dqa (32-bit mode), dqq (64-bit mode), dqu, dsx
> SSE-3: Compare strings using cmpsdx, cmpsd, scansigndx, scansignd
> SSE-2: Compare strings using pmaxsw, pand, pmin, pmins
> SSE-1: Compare strings using pandn, pavg, pandnpand, pandnpandn, pandn, pandnpandndivr, ...
- deleted 4y ago[deleted]
- anonymoushn 4y agoIf you want to write a fast parser you mostly don't end up using these. You use pshufb, as detailed in a sibling comment by stabbles.
- amelius 4y agoBut this is not strictly speaking a string compare operation, I suppose.