Commit e6fbf84
committed
New implementation of strlcpy based on OpenBSD - should be dramatically
faster the bigger the string is. Anywhere from 47x faster with 1KB strings
to 819x faster with very long, truncated strings. It's a naive two-pass
implementation using strlen and memcpy. These builtins are often SIMD
accelerated in the standard library, hence much faster throughput vs
the naive hand rolled version1 parent b97939c commit e6fbf84
1 file changed
Lines changed: 9 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
43 | 41 | | |
44 | 42 | | |
45 | 43 | | |
| |||
0 commit comments