3 ms·
> That allows for elegant constructions in C such as: > while (*p++ = *q++); Elegant? It's short, if you don't include code for buffer management and validat
by vardump 11y ago
> That allows for elegant constructions in C such as:
> while (*p++ = *q++);
Elegant? It's short, if you don't include code for buffer management and validation.
It maps very poorly to modern CPUs as-is, unless the compiler recognizes it as strcpy and replaces it with appropriate code. Luckily most compilers are capable of that. Otherwise loop termination condition causes (most?) compilers not to even try vectorization and an order of magnitude of performance is lost.
- camperman 11y ago"It maps very poorly to modern CPUs as-is" Indeed. When I said I read this a long time ago, I meant decades :)