Comments (4)
Thank you for your suggestion.
I updated benchmark results with hyperfine.
rg/fastmod is fast in the case of many files,
and amber has advantage in the case of large file search.
from amber.
Nice, cool to see the benchmark. I am surprised that amber seems faster here. Maybe @BurntSushi might be interested in this.
from amber.
Benchmarks should include checks for correctness, otherwise the whole endeavor is moot:
$ time rg '検索結果' jawiki-latest-pages-articles.xml | wc -l
6455
real 1.499
user 1.060
sys 0.437
maxmem 10914 MB
$ time LC_ALL=en_US.UTF-8 grep '検索結果' jawiki-latest-pages-articles.xml | wc -l
6455
real 3.535
user 2.199
sys 1.333
maxmem 4 MB
$ time ~/clones/amber/target/release/ambs '検索結果' jawiki-latest-pages-articles.xml | wc -l
7048
real 0.796
user 6.399
sys 1.499
maxmem 10871 MB
Assuming it's a simple logical bug that doesn't impact performance, then yeah, this is a very nice validation of the idea to search a single file in parallel. If you use regexes correctly, then it might go even faster, since a regex's literal search should be better than the ones you've hand-rolled. But right now, the code is unnecessarily doing UTF-8 validation, which kills the entire enterprise. Instead, you should be using regex::bytes::Regex
.
Nice work @dalance!
from amber.
@BurntSushi
Thank you for your comment.
Currently amber show line by match. So the line matched repeatedly is duplicated.
I'll fix it, and try regex::bytes::Regex
.
from amber.
Related Issues (20)
- Default to Ignoring the Script that Called Amber
- Make better parametrisation and help
- Feature request : Add `--verbose` flag HOT 1
- Question : What does amb(er) stand for? HOT 1
- Feature Request: Add option to replace/skip all in file
- Using on Windows Server 2022 error HOT 1
- crates.io HOT 1
- Pick a line
- search for a phrase?
- unnecessary parentheses around match arm expression HOT 1
- "--" replacement string seen as an argument flag HOT 2
- include/exclude files by glob
- ambr fails to match/replace some match with `- ` HOT 1
- New release timeline HOT 3
- Add support to ignore filenames (by regex?) HOT 1
- This project is great!
- Err… Error? HOT 4
- Regex issues HOT 1
- Random "Permission denied" error on Windows
- Support for renaming file names HOT 2
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 amber.