4 ms·
0.25s for 200MB (in memory) seems pretty slow for a modern CPU (800MB/s) which is more than an order of magnitude below what you would expect from main memory.
by loser777 8y ago
0.25s for 200MB (in memory) seems pretty slow for a modern CPU (800MB/s) which is more than an order of magnitude below what you would expect from main memory.
There can be a lot of performance left on the table even in standard library implementations: http://0x80.pl/articles/simd-strfind.html http://0x80.pl/articles/simd-strfind.html
- Rapzid 8y agoThis isn't super surprising to me. String comparisons are super slow if not handle with care, and even then may be surprisingly slow. This does a LOT of string comparisons. Depending on the requirements, sliding a window through doing byte comparisons may be better. https://golang.org/src/bytes/bytes_decl.go?s=522:550#L7 https://golang.org/src/bytes/bytes_decl.go?s=522:550#L7 EDIT: I believe paper trail does or did have a limitation on case sensitive searching. You can imagine why they may be doing this if you consider the performance implications.