3 ms·
sprintf(target, "%s%s", s1, s2); Now, why would one not just use good old strcat? Well, there are three reasons: - This is faster. Its about 20% faster
by eqvinox 7y ago
sprintf(target, "%s%s", s1, s2);
Now, why would one not just use good old strcat? Well, there are three reasons:
- This is faster. Its about 20% faster than strcat,
since it accesses the string stored in target with a
SYSCALL instead of looping over it. I have checked
using GCC 9.3 on Manjaro with kernel 5.4 (Linux).
WTF? sprintf is not a syscall. Also, syscalls make things slower, not faster.
?!?