Coder Social home page Coder Social logo

rbartlensky / rpools Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 0.0 466 KB

Pool implementations to save memory

License: GNU General Public License v3.0

CMake 2.91% Python 9.25% C++ 71.04% Shell 0.13% C 13.24% HTML 1.21% JavaScript 1.86% CSS 0.35%
c-plus-plus-11 c-plus-plus allocator pool pool-allocator llvm-pass memory-allocator

rpools's Introduction

rpools

Build commands:

  • cd benchmarks && python3 generate_alloc_file.py && cd .. - to include allocation benchmarks (optional)
  • mkdir build && cd build && cmake .. && make - to build the project
  • make install - to install the libraries
  • make test - runs the tests of the project (this assumes that the project is built)
  • pip install -r ./requirements.txt will install all the dependencies of all python scripts

plot_elapsed_time.py

This is used to plot the different outputs of the executables from benchmarks/elapsed_time/.

Usage (make sure you build the project first):

  • python3 plot_elapsed_time.py -h to see the help menu

Examples:

  • python3 plot_elapsed_time.py -b ./build/benchmarks/elapsed_time/bench_random -n 100000

Explanation (can also be found in the help menu of the script):

  • ./build/benchmarks/elapsed_time/bench_random - the executable that we want to execute
  • 100000 - the upperbound of objects that will be created (in the case of bench_worst, the upperbound is multiplied by the size of the pool)

plot_memory_usage

This is used to plot the output of the command: valgrind --tool=massif --stacks=yes --time-unit=ms on all the executables from benchmarks/memory_usage/.

Usage (make sure you build the project first):

  • python3 plot_memory_usage.py -h to see the help menu

inject_custom_new

This is a script which is used to run an executable with a custom new/delete implementation. The custom new/delete library implements these operators by using the linked_pool/NSGlobalLinkedPool class to (de)allocate small objects and malloc to (de)allocate large objects.

Usage (make sure libcustomnew.so is installed):

  • inject_custom_new my_exec args1 args2 - to run your executable with the custom implementation that is also thread safe

benchmarks/generate_alloc_file.py

This is a script that will generate allocation benchmarks. By running this script, the CMakeLists.txt file will change and next time make is called, the benchmarks will be compiled.

Note: Make sure you run this script from the benchmarks folder.

time_alloc_benchmarks.py

This is a script which is used to run all the allocation benchmarks.

Usage:

  • python3 time_alloc_benchmarks.py -h for instructions.

Note: Make sure generate_alloc_file.py was run and the project was built.

Licenses!

Everything is GPLv3 except for the following files which have their own license:

  • include/rpools/tools/light_lock.h (check source)
  • src/avltree/avltree.c (check source)
  • include/rpools/avltree/avltree.h (check source)
  • src/allocators/MemoryPool.h (MIT)

rpools's People

Contributors

andrewcoles avatar rbartlensky avatar

Watchers

 avatar  avatar  avatar  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.