Earlier quoted context omitted.
This isn’t code in some project that will run only a few billion times in its lifetime; it is used frequently on millions, if not billions, of computers. Because of that, it is economical to spend lots of time optimizing it, even if it only makes the code marginally more efficient.
That's not how economics works. If 100 million people each save 1 cent because of your work, you saved 1 million in total, but in practice nobody is observably better off.
Linux Pipes Are Slow
81–90 of 171 posts
Re: Linux Pipes Are Slow
#82A bold claim for a blog that takes about 20 seconds to load.
Re: Linux Pipes Are Slow
#83Calling Linux pipes "slow" is like calling a Toyota Corolla "slow". It's fast enough for all but the most extreme use cases. Are you racing cars? In a sport where speed is more important than technique? Then get a faster car. Otherwise stick to the Corolla.
Re: Linux Pipes Are Slow
#84Re: Linux Pipes Are Slow
#85Re: Linux Pipes Are Slow
#86Be interesting to see a version using io_uring, which I think would let you pre-share buffers with the kernel avoiding some copies, and avoid syscall overhead (though the latter seems negligible here).
Re: Linux Pipes Are Slow
#87Earlier quoted context omitted.
This isn’t code in some project that will run only a few billion times in its lifetime; it is used frequently on millions, if not billions, of computers. Because of that, it is economical to spend lots of time optimizing it, even if it only makes the code marginally more efficient.
That's not how economics works. If 100 million people each save 1 cent because of your work, you saved 1 million in total, but in practice nobody is observably better off.
Re: Linux Pipes Are Slow
#88> I do not know why the JMP is not just a RET, however. This is caused by the CONFIG_RETHUNK option. In the disassembly from objdump you are seeing the result of RET being replaced with JMP __x86_return_thunk. https://github.com/torvalds/linux/blob/v6.1/arch/x86/include... https://github.com/torvalds/linux/blob/v6.1/arch/x86/lib/ret... > The NOP instructions at the beginning and at the end of the function allow ftrac…
Re: Linux Pipes Are Slow
#89Earlier quoted context omitted.
I'll write an article on the flamegraphs specifically, but to get the data, just follow Julia's article! https://jvns.ca/blog/2017/03/19/getting-started-with-ftrace/
Could you clarify how are you testing the speed of the first example where you are not writing anything to stdout? Thanks.
Re: Linux Pipes Are Slow
#90Calling Linux pipes "slow" is like calling a Toyota Corolla "slow". It's fast enough for all but the most extreme use cases. Are you racing cars? In a sport where speed is more important than technique? Then get a faster car. Otherwise stick to the Corolla.