Code Monkey home page Code Monkey logo

Comments (4)

dalance avatar dalance commented on May 24, 2024

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.

pickfire avatar pickfire commented on May 24, 2024

Nice, cool to see the benchmark. I am surprised that amber seems faster here. Maybe @BurntSushi might be interested in this.

from amber.

BurntSushi avatar BurntSushi commented on May 24, 2024

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.

dalance avatar dalance commented on May 24, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.