|
|
|
|
|
by Koromix
3590 days ago
|
|
You're looking at this problem backward. For example, you mention user input. Users may need a second to click or touch a button, but when they do the software should react instantly, and that does not leave you that many cycles. My smartphone's lock screen is my go-to example: most times it fails to follow my finger, and I barely have anything running on it. Most of the dynamic languages are data and instruction cache-miss machines. They chase objects and pointers all around the memory. |
|
...That doesn't sound like a cache miss. Knowing Android, A cache miss is probably the least of your worries.
>Users may need a second to click or touch a button, but when they do the software should react instantly, and that does not leave you that many cycles.
You raise a good point...
>Most of the dynamic languages are data and instruction cache-miss machines. They chase objects and pointers all around the memory.
...and this is part of my point. If you look at a problem and think, "A high-level language is fast enough," then you are implicitly saying that the latency of a cache miss is acceptable. And IME, in most cases that's true. I mean, heck, I'm using Scheme, so while I may have pointer chases like the Amazon has trees, but I CAN optimize them into array lookups, and my code is compiled: not great, but better than most HLLs.
It's the same argument as always: perf vs. development speed. You can be in the C and FP loop, or the Lisp and JS loop.