Comments (6)
... which leads to this philosophical question: what is the selling point of headtail?
For me, it is purely the ability to be able to head AND tail in a simultaneous operation.
I'm not opposed to attempting to optimize performance as a secondary goal, but I sincerely doubt many people will ever be searching for a combined head and tail utility because either head or tail is too slow.
Actually, I see performance as more of a tertiary goal, with other useful features being the secondary goal (like following a file while tailing -- which I didn't actually need, but was fun to do).
from headtail.
As a utility whose name begs to be used alongside if not replace head
and tail
, I think the "benchmark" that's more anticipated in our introduction would be how does it fare against the OG coreutils counterparts.
For example, as a reader I want to know how
headtail somebigfile.txt
compares (after rigorous experiments) against
head somebigfile.txt && tail somebigfile.txt
Or headtail somebigfile.txt -H 25 -T 0
against head somebigfile.txt -n 25
?
(Unless I misunderstood "when we make changes we can do a before/after comparison. See criterion.", which to me sounds like using the micro-benchmarking tool to do regression testing.)
from headtail.
Those all sound good to me!
from headtail.
Those all sound good to me!
Awesome. Working on it! 🤓
from headtail.
I found about hyperfine while researching about how such benchmarking could be done. https://github.com/uutils/coreutils/blob/main/src/uu/head/BENCHMARKING.md
There are a couple of options that we could do imo.
- Reference that link and/or add "Benchmarking" section to our readme
- Compile a table of numbers (a la https://github.com/BurntSushi/ripgrep#quick-examples-comparing-tools)
====
This is what hyperfine outputs for me:
hyperfine --warmup 3 "head tests/files/input.txt && tail tests/files/input.txt" "target/release/headtail tests/files/input.txt"
Benchmark 1: head tests/files/input.txt && tail tests/files/input.txt
Time (mean ± σ): 5.4 ms ± 0.8 ms [User: 2.0 ms, System: 1.8 ms]
Range (min … max): 4.9 ms … 8.8 ms 263 runs
Benchmark 2: target/release/headtail tests/files/input.txt
Time (mean ± σ): 7.3 ms ± 0.9 ms [User: 4.7 ms, System: 1.8 ms]
Range (min … max): 6.6 ms … 10.9 ms 280 runs
Summary
'head tests/files/input.txt && tail tests/files/input.txt' ran
1.34 ± 0.25 times faster than 'target/release/headtail tests/files/input.txt'
... which leads to this philosophical question: what is the selling point of headtail? Is being at least as fast as GNU coreutils counterparts a non-goal? What do you think? @CleanCut
from headtail.
In any case, that meaning of benchmark should be a separate github issue (if regarded valid at all). My next pull-request will be adding criterion for before/after change comparison ✌️.
from headtail.
Related Issues (11)
- Set up CodeQL
- Set up Dependabot HOT 2
- Readme Improvements
- Add missing integration tests
- Change follow to use a file watcher when possible
- Add unit tests
- Add option to output to a file HOT 2
- Does this work on Windows? HOT 2
- Upgrade to clap v4 HOT 2
- Ellipses (`...`) in between head and tail output HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from headtail.