2 ms·
well, I am having this comment because I had to spend months optimizing some UIs which updated thousands of elements per second with this kind of mechanism - ne
by jcelerier 8y ago
well, I am having this comment because I had to spend months optimizing some UIs which updated thousands of elements per second with this kind of mechanism - needless to say, it doesn't scale, especially when your average user has a core 2 duo.
- jstimpfle 8y agoCallbacks are often not the best approach. How about "inverting" the control by having a function which first collects all the elements to act on and then acts on them? This should prevent problems with cache misses since you perform only one kind of thing (on all elements) at a time. Where this kind of reordering is possible. (The callback approach is OOP I would say. And as always, OOP prevents us from seeing the better way to structure processing).
- jcelerier 8y agoproblems happen as soon as the elements you want to display aren't known at compile time and can't be stored in a nice, data-oriented approach, but instead come from various plug-ins that the user can download and put as DLLs in the app's folder.