News for hackers. Stuff that matters.
Re:Comprehensive Keyboard Handling in Terminals by petepete on Monday April 03, 2023 @04:03AM (#35420097)
It's not the grep that's slow, it's the printing of a hundred thousand character minified line of JavaScript. Unintentional, but every dev's done it or similar. I used to have to kill urxvt, which I used for nearly 15 years.
Re:Comprehensive Keyboard Handling in Terminals by nextlevelwizard on Monday April 03, 2023 @06:26AM (#35421138)
>printing of a hundred thousand character minified line of JavaScript.

Yeah... Terminal is not the issue, rather why you have 100000 line js file in the first place.

Re:Comprehensive Keyboard Handling in Terminals by nextlevelwizard on Monday April 03, 2023 @10:31AM (#35424214)
This really started to bother me. How does terminal emulator speed up grepping a large file?

I made a random file with 100 000 lines and using 3 different terminals (Default Terminal, iTerm2, and Kitty) and using two different grep tools (grep and rip-grep) with and without tmux I can not see any meaningful performance difference.

Do I just not understand what terminal emulators do? How does choice of text printing matter when you run a script?

I could see a tiny performance improvement with kitty when I ran just cat on the file in a loop, but the difference was so tiny that if you want to argue that this is the performance benefit worth using kitty for I have bad news for you since the worst case with kitty was then noticeably worse than in competition.

Re:Comprehensive Keyboard Handling in Terminals by petepete on Tuesday April 04, 2023 @07:15PM (#35447127)
Re:Comprehensive Keyboard Handling in Terminals by nextlevelwizard on Wednesday April 05, 2023 @01:50AM (#35449860)
Yes? Why do you need 100000 characters of JS? Maybe de-bloat your shit. Also grepping through that is even easier than 100_000 lines (which I assumed you meant since grepping over one line of 1_000_000 characters takes so little time that is not any kind of argument)
Re:Comprehensive Keyboard Handling in Terminals by petepete on Wednesday April 05, 2023 @04:23PM (#35459866)
It's not the grepping that takes the time, it's the printing the highlighted output to the terminal. Keep up.