Git Product home page Git Product logo

remem's Introduction

  • The rust version can just be cargo run'd.

  • The C++ version can be built with make remem, it requires re2, a flake is available if useful.

  • Both take a single regex through stdin (beware newlines and shell escaping / evaluation if using echo), compile it, then runs it against nonsense input to try and estimate capture memory overhead, the two values printed to stdout are the allocations (minus deallocations) for compilation, and the allocations (minus deallocations) for capture.

  • make will build both and run them against the regexen sample via the run script (which requires Python), printing the values for each then the regex on stdout in an ascii table.

    Various variants of each gets run:

    • re2 utf8 mode
    • re2 latin1 mode, not entirely clear what it does but it impacts memory use so seemed fair
    • regex unicode + string
    • regex ascii + string -- this is the only mode which can fail to compile a regex, in which case the entries are -
    • regex ascii + bytes

    regex unicode + bytes is a valid mode for the binary, but it seems to have the same memory behaviour as unicode + string so was not included in the run script.

The Rust version uses a custom allocator to measure allocations, the C++ version overrides new and delete and stashes the requested size in the allocation to know how much allocations decrease it.

remem's People

Contributors

masklinn avatar

Watchers

 avatar

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.