2 ms·
> A big reason is the good old 'passing by pointer is faster' Not even with old compilers, necessarily, this is more about the CPU architecture. If you've got
by SAI_Peregrinus 7y ago
> A big reason is the good old 'passing by pointer is faster'
Not even with old compilers, necessarily, this is more about the CPU architecture. If you've got an architecture with no cache (eg 386 and below for Intel) you'll not care about cache miss vs cache hit, but once you have cache you'll often find that the pointer dereference will hit main memory, and thus be slower than just passing by value. Not always, of course, but sometimes, so since 1989 (for Intel) you've needed to profile that to be sure.