Giter Club home page Giter Club logo

dedup's Introduction

Dedup

Deep object deduplication.

If your app keeps lots of static data in memory, such as i18n data or large configurations, this can reduce memory retention.

Installation

Add this line to your application's Gemfile:

gem 'dedup'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install dedup

Usage

This library is meant to be called on large static data structures loaded during boot:

SOME_DATA = Dedup.deep_intern!(YAML.load_file('path.yml'))

Keep in mind that it trades CPU during boot reduced for memory retention. It isn't meant to be applied on runtime data with reduced lifetime, but on static data loaded during boot.

Development

After checking out the repo, run bin/setup to install dependencies. Then, run rake test to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dedup.

License

The gem is available as open source under the terms of the MIT License.

dedup's People

Contributors

byroot avatar casperisfine avatar alexcrocha avatar flavorjones avatar

Stargazers

 avatar Martin Ziserman avatar Dmytro Piliugin avatar Bohdan Zhuravel avatar Pavel Bonda avatar Li Ding avatar Tarun Chaudhry avatar Brian Rossetti avatar

Watchers

Shay avatar Lourens Naudé avatar Elvio Vicosa avatar Matthew Higgins avatar Jeff Bruton avatar Mai avatar Alexander Leach avatar Lucas Souza avatar Theo Oikonomou avatar @lamp avatar Ryan Florence avatar Stella Miranda avatar Ben Watts avatar Ben Doyle avatar Stephen Hunter avatar tetchi avatar Luiz Adolpho avatar Bart Piotrowski avatar Jon Yonker avatar Shadab Rashid avatar Christian Shum-Harden avatar Jeremy Morony avatar Nicholas Pan avatar Dan Menard avatar Mark Ryan avatar Michael Nugent avatar Sebastian Skopp avatar Julia Winn avatar James Cloos avatar Thiago Colares avatar Chris Waters avatar Misha Korablin avatar Thomas Conner avatar Stephen Hukish avatar Ryan Self avatar Karthik K N avatar Corwin Brown avatar Arpan Podduturi avatar João Júnior avatar Daniel Leroux avatar Igor Kozlov avatar Chris Shaw avatar Alex Fi avatar Ahmad Alhour avatar Nik Ivanov avatar Tim Lombardo avatar Javier Barrera avatar Kaj Drobin avatar Paul Gagliardi avatar Annett Forcier avatar Conor Malone avatar Guil H avatar josh sucher avatar Satish Kanwar avatar Liz McDonald avatar Ann  Wallace avatar Alejandro Gonzalez avatar  avatar Topher Bullock avatar Anita Mehrotra avatar Weslley Araujo avatar  avatar Sharad Gaur avatar  avatar Dave McVittie avatar Yungjae avatar Jared Rader avatar Ravi Byakod avatar Robleh Jama avatar Nick Lee avatar Collin Brink avatar Damyan Petkov avatar Julia Nguyen avatar Armando avatar David Little avatar Nicholas Simmons avatar Juan Guzman avatar Kirsten Westeinde avatar Solmaz avatar Michael Beddall avatar Pauline Ramos avatar  avatar  avatar Bernardo Camilo avatar  avatar ryan avatar Sergio Roysen avatar Ian Martin avatar Will Mowat avatar John Benson avatar Arbab Ahmed avatar Alicia Bargar avatar Mallory Allen avatar Nick Bell avatar Bhavika Tekwani avatar Derek Braid  avatar  avatar Hamza avatar  avatar  avatar

dedup's Issues

version 0.1.1 fails to compile

⋊> ~/s/g/S/billing on master ◦ gem install dedup -v '0.1.1'
Building native extensions. This could take a while...
ERROR:  Error installing dedup:
        ERROR: Failed to build gem native extension.

    current directory: /Users/kmdavis/.gem/ruby/2.6.5/gems/dedup-0.1.1/ext/dedup
/opt/rubies/2.6.5/bin/ruby -I /opt/rubies/2.6.5/lib/ruby/2.6.0 -r ./siteconf20200911-2590-blnc8i.rb extconf.rb
creating Makefile

current directory: /Users/kmdavis/.gem/ruby/2.6.5/gems/dedup-0.1.1/ext/dedup
make "DESTDIR=" clean

current directory: /Users/kmdavis/.gem/ruby/2.6.5/gems/dedup-0.1.1/ext/dedup
make "DESTDIR="
compiling dedup.c
dedup.c:67:17: error: implicit declaration of function 'rb_hash_bulk_insert' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                rb_hash_bulk_insert(arg.index, arg.pairs, data);
                ^
1 error generated.
make: *** [dedup.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/kmdavis/.gem/ruby/2.6.5/gems/dedup-0.1.1 for inspection.
Results logged to /Users/kmdavis/.gem/ruby/2.6.5/extensions/x86_64-darwin-19/2.6.0-static/dedup-0.1.1/gem_make.out

I encountered this while dev uping billing master

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.