[HN Gopher] Linux Pipes Are Slow
___________________________________________________________________
Linux Pipes Are Slow
Author : qsantos
Score : 24 points
Date : 2024-08-25 16:52 UTC (6 hours ago)
(HTM) web link (qsantos.fr)
(TXT) w3m dump (qsantos.fr)
| jheriko wrote:
| just never use pipes. they are some weird archaism that need to
| die :P
|
| the only time ive used them is external constraints. they are
| just not useful.
| henearkr wrote:
| Pipes are extremely useful. But I guess it just depends on your
| use case. I do a lot of scripting.
|
| If you dislike their (relative) slowness, it's open source, you
| can participate in making them faster.
|
| And I'm sure that after this HN post we'll see some patches and
| merge requests.
| noloblo wrote:
| +1 yes pipes are what shell scripting quite useful and allow
| for easy composition of the different unix shell utilities
| hnlmorg wrote:
| The very thing that makes pipes useful is what also makes
| them slow. I don't think there is much we can do to fix that
| without breaking POSIX compatibility entirely.
|
| Personally I think there's much worse ugliness in POSIX than
| pipes. For example, I've just spent the last couple of days
| debugging a number of bugs in a shell's job control code
| (`fg`, `bg`, `jobs`, etc).
|
| But despite its warts, I'm still grateful we have something
| like POSIX to build against.
| akira2501 wrote:
| > just never use pipes.
|
| vmslice doesn't work with every type of file descriptor.
| eschewing some technology entirely because it seems archaic or
| because it makes writing "the fastest X software" seem harder
| is just sloppy engineering.
|
| > they are just not useful.
|
| Then you have not written enough software yet to discover how
| they are useful.
| w0m wrote:
| You can replace a 10k line python or shell script with a single
| creative line of pipes/xargs/etc on the cli.
|
| It's incredibly valuable on the day to day.
| hagbard_c wrote:
| That's like telling a builder never to use nails but turn to
| adhesives instead. He will look at his hammer and his nails as
| well as a stack of 2x4s, grin and in no time slap together a
| box into which he will stuff you with a bottle of glue with the
| advice to now go and play while the grown-ups take care of
| business.
|
| Sure, you could build that box with glue and clamps and ample
| time, sure it would look neater and weigh less than the version
| that's currently holding you imprisoned and if done right it
| will even be stronger but it takes more time and effort as well
| as those glue clamps and other specialised tools to create
| perfect matching surfaces while the builder just wielded that
| hammer and those nails and now is building yet another
| utilitarian piece of work with the same hammer and nails.
|
| Sometimes all you need is a hammer and some nails. Or pipes.
| nitwit005 wrote:
| Just about every form of IPC is "slow". You have decided to pay a
| performance cost for safety.
| djaouen wrote:
| So is Python, but I'm still gonna use it lol
___________________________________________________________________
(page generated 2024-08-25 23:00 UTC)