Return to Level1Techs.com

The absolute state of programming. And the sed 11q meme

Y’all have Threadrippers right?

but wait, it doesn’t scale with cores, so uhh…

1 Like

i7 9700k oc to 5.4ghz on a chiller, with the internet disconnected so you dont take any microcode updates to kill the SPEED.

2 Likes

You’ve missed the opportunity to call the thread “cat abuse”.

4 Likes

Umm…

why did you test cat piped into head?

Well, I didn’t here, mainly coz I don’t know how to make parf stat like pipes.

But as a separate scripts, it’s 5% overhead.

1 Like

Just saw the screenshot above.

Criticizes Speed
Uses zsh with Oh My Zsh

:wink:

I actually have no idea if Oh My Zsh causes lag or overhead, but Adubs can’t be the only one that pokes at Gek

2 Likes

My Xeon would kill your Bulldozer any day of the week, friend.

2 Likes

it’s def slower than fish. Am just too lazy to switch atm.

2 Likes

Oh yeah? well my non k i5 will shit on your xeon in python speed

1 Like

Install all the shells

image
image

2 Likes

use python as a shell, no wait

((( node )))

1 Like

I’ll use you as a shell and throw you at @AnotherDev’s kart so I can win the race.

checkmate.

1 Like

Using Arch should have been your first clue.

This was interesting, engagement at maximum

SLANDEROUS LIES

2 Likes

Thank you so much. I knew sed 11q had to be a meme, I’ve been watching Luke’s channel for a while, but I have previous life experiences with other people, so I trained myself not to fall for the cult of personality. Basically, don’t trust everything someone says. I wasn’t interested in python, but in head vs sed. From my own basic testing I found similar results:

This is bash’ time built-in command

[[email protected] ~]$ time head .bashrc
[output omitted]
real 0m0.001s
user 0m0.001s
sys 0m0.000s

[[email protected] ~]$ time sed 11q .bashrc
[output omitted]
real 0m0.003s
user 0m0.000s
sys 0m0.003s

[[email protected] ~]$ time sed 6q .bashrc
[output omitted]
real 0m0.003s
user 0m0.003s
sys 0m0.000s

And from running those in dash with /usr/bin/time:

$ time -v head .bashrc

[output omitted]

    Command being timed: "head .bashrc"
    User time (seconds): 0.00
    System time (seconds): 0.00
    Percent of CPU this job got: 88%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 1756
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 76
    Voluntary context switches: 1
    Involuntary context switches: 2
    Swaps: 0
    File system inputs: 0
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

$ time -v sed 11q .bashrc

[output omitted]

    Command being timed: "sed 11q .bashrc"
    User time (seconds): 0.00
    System time (seconds): 0.00
    Percent of CPU this job got: 100%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 2308
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 133
    Voluntary context switches: 1
    Involuntary context switches: 1
    Swaps: 0
    File system inputs: 0
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

$ time -v sed 6q .bashrc
[output omitted]

    Command being timed: "sed 6q .bashrc"
    User time (seconds): 0.00
    System time (seconds): 0.00
    Percent of CPU this job got: 50%
    Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
    Average shared text size (kbytes): 0
    Average unshared data size (kbytes): 0
    Average stack size (kbytes): 0
    Average total size (kbytes): 0
    Maximum resident set size (kbytes): 2200
    Average resident set size (kbytes): 0
    Major (requiring I/O) page faults: 0
    Minor (reclaiming a frame) page faults: 132
    Voluntary context switches: 1
    Involuntary context switches: 1
    Swaps: 0
    File system inputs: 0
    File system outputs: 0
    Socket messages sent: 0
    Socket messages received: 0
    Signals delivered: 0
    Page size (bytes): 4096
    Exit status: 0

Just for reference:

  • cpu: Intel® Pentium® CPU G4560 @ 3.50GHz
  • kernel: 5.6.16-1-MANJARO
  • head version: head (GNU coreutils) 8.32
  • sed version: sed (GNU sed) 4.8

/usr/bin/time doesn’t seem to be very accurate, I ran it multiple times and got wildly varying results for CPU usages and other stats, sed was jumping all over the place, on average from 50 to 100%, while head was also jumping, but was more consistent, on average around 70-79% usage (I had all 3 commands jump between 0 and 100, just very few times). I’ll just be using head.

The point is: it’s funny that people get into Linux and the UNIX philosophy of doing 1 thing and doing it well, yet there are many Linux users out there who say “don’t use sed at all, use just awk” or “don’t use awk at all, just use sed” (sorry for being vague, I think one big name was DistroTube, that was a proponent of awk - correct me if I’m wrong, I only saw parts of him saying this, maybe out of context and I’m not interested in his channel). I understand using just 1 tool when you have to use the tool, like using just awk instead of grep + awk, but when you don’t need awk or sed, just use what is the most efficient, which in this case is head.

:rofl: :smiley:
I love this thread.
@redgek I wish there were more guys like you working on gnome-shell, coz they apparently have no idea what perf means.

Given OP is no longer on this forum and the topic is past necro age, im gonna put this one to bed. If you’d like to continue the discussion, feel free to create a new topic and link to this one.