4 ms·
> In other words: your system supports calling the time system call via the Linux kernel’s vDSO to avoid the cost of switching to the kernel. But, as soon as yo
by AceJohnny2 10y ago
> In other words: your system supports calling the time system call via the Linux kernel’s vDSO to avoid the cost of switching to the kernel. But, as soon as your program calls time, it calls localtime immediately after, which invokes a system call anyway.
This reminds me of an article by Ted Unangst[1], in which he flattens the various libraries and abstractions to show how xterm (to cite one of many culprits) in one place is effectively doing:
if (poll() || poll())
while (poll()) {
/* ... */
}
In other words, if you don't know what your library/abstraction is doing, you can end up accidentally duplicating its work.
Reminds me of some aphorism, "Those who do not learn from history..." ;)
[1] http://www.tedunangst.com/flak/post/accidentally-nonblocking http://www.tedunangst.com/flak/post/accidentally-nonblocking
discussed https://news.ycombinator.com/item?id=11847529 https://news.ycombinator.com/item?id=11847529
- nsxwolf 10y agoThose who quote George Santayana are condemned to repeat him.
- andrewbinstock 10y agoThose who don't know George Santayana are condemned to repeat him. FTFY.
- koverstreet 10y agoYou seem to have missed the joke...
- btown 10y agoYou seem to have missed the joke... wait a second...
- andrewbinstock 10y agoTotally got it. It's a refinement of the line. As the person below understands.
- barrystaes 10y agoApparently, i under stand.
- segmondy 10y agoWith the layering of clusters, containers, micro services, bet you probably have 10x worse than that. There is always a cost to abstraction. On the surface it might make things simpler but if you were to peel it apart, you would reveal a hidden layer of complexity. Hopefully, it's done well right enough that there will never be a need to peel it apart.
- nomel 10y ago> On the surface it might make things simpler but if you were to peel it apart, you would reveal a hidden layer of complexity. Well yes, This is the very definition and goal of abstraction.
- jwhitlark 10y agoThis is why I always liked the idea of Unikernels, they let us reset our abstractions without giving up all we've learned in the last couple decades.
- JdeBP 10y agoXe just did mplayer as well. It calls non-blocking select(), then non-blocking poll(), then nanosleep(), in a loop. * http://www.tedunangst.com/flak/post/mplayer-ktracing http://www.tedunangst.com/flak/post/mplayer-ktracing