fish vs bash: a progress bar from YSAP and some timing measurements
Thanks, Evan, for bringing fish shell to my attention. I'm really liking it - it's just what I needed and didn't even know it. So, I'd mentioned it feeling faster, which William commented on. Thanks William, you got me thinking. "Feels faster" ≠ "is faster" and I thought I'd measure something. And along comes Dave from YSAP with a great video on how to make a progress bar in bash. https://www.youtube.com/watch?v=aL3xdQyMs5o I love his videos, he's highly knowledgeable and quite engaging. He make bash scripting look fun. I decided to implement his idea without too much peeking at the solution, then re-implement it in fish. Despite me saying earlier that I'd probably continue scripting in bash. The fish syntax is *so much better*. When I went to add a feature to the bash script, once again I got caught up in punctuation hell, where fish mostly eschews that inscrutable mess for things like: $ math "10 * 5 / 100" 0.5 Note the floating point math... When done, I ran them both with the `time` command, and bash version was consistently faster (results at bottom of message). However, if one takes into account dev time, fish is faster despite it being new to me. So it depends on how you rank run time vs dev time which is "faster", but I'm giving the win to fish in this case. Adding to that the luxurious interactive features and it's a no-brainer: fish is the (my) future. The tab-completion is light years ahead of bash (but so is the tab completion in node.js, bash is kind of lagging behind here these days). $ time ./progress-bar.bash START: files count: 500 Batch size: 3 [||||||||||||||||||||||||||||||||||||||||||||||||||] 500/500 (100)% ________________________________________________________ Executed in 1.04 secs fish external usr time 115.62 millis 545.00 micros 115.08 millis sys time 58.08 millis 214.00 micros 57.87 millis $ time ./progress-bar.fish START: files count: 500 Batch size: 3 [ ] 500/500 (100)% ________________________________________________________ Executed in 1.50 secs fish external usr time 490.80 millis 0.00 micros 490.80 millis sys time 148.81 millis 760.00 micros 148.05 millis
On 8/23/25 1:29 AM, Ron via Talk wrote:
And along comes Dave from YSAP with a great video on how to make a progress bar in bash. https://www.youtube.com/watch?v=aL3xdQyMs5o
This link took me to some Japanese MMA/amateur video.
I love his videos, he's highly knowledgeable and quite engaging. He make bash scripting look fun.
-- Alvin Starr || land: (905)513-7688 Netvel Inc. || Cell: (416)806-0133 alvin@netvel.net ||
Alvin Starr via Talk wrote on 2025-08-24 17:09:
And along comes Dave from YSAP with a great video on how to make a progress bar in bash.
This link took me to some Japanese MMA/amateur video.
Well I feel dumb. Somehow I clicked on the wrong thumbnail to copy and it's not even a good video. My apologies. THIS is the correct video link: https://www.youtube.com/watch?v=U4CzyBXyOms
On 8/25/25 12:01 AM, Ron via Talk wrote:
Alvin Starr via Talk wrote on 2025-08-24 17:09:
And along comes Dave from YSAP with a great video on how to make a progress bar in bash. https://www.youtube.com/watch?v=aL3xdQyMs5o
This link took me to some Japanese MMA/amateur video.
Well I feel dumb. Somehow I clicked on the wrong thumbnail to copy and it's not even a good video.
My apologies.
Not a problem. After figuring out that it was not yet another YouTube ad I tried to search a bit to see where the real content started. It is good to see other people click on the wrong thing and not just me. -- Alvin Starr || land: (905)513-7688 Netvel Inc. || Cell: (416)806-0133 alvin@netvel.net ||
participants (2)
-
Alvin Starr -
Ron