-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory refactor - follow up #6 (rebased) #8
base: master
Are you sure you want to change the base?
Conversation
refactor etld data generation to generate the yaml and cache file on rake, cleaning up some code in the process ruby 1.8 does not have File.binread remove derailed development dependency fixes Rakefile to revert calling the data generation tool without any rake task and fix bug in data update updates data to 2015-09-15 17:22:03 +0200 and change test since .cy domain changed prefers YAML.dump(content, file) to file.write content.to_yaml prefers plain YAML to Marshall binary
Hmm, so, using "yaml" makes this library consume as much memory as it does now, right? Is it that "yaml" is a popular library so it does not count in most apps? |
If the motivation for this PR is to reduce memory footprint when your app happens to load this library via dependencies but does not actually use DomainName at all, what if you just use autoload or a similar technique to simply delay the loading of domain_name/etld_data.rb, instead of using yaml or marshal? Is using a deserializer better than generating data in byte-code, as I asked in the previous PR? Can you get numbers of memory footprint after eTLD data is loaded, with and without this change? |
I'm finally getting to grasp what your PR is about, so pardon for asking so many questions. 😅 |
@knu I'm sorry I'm not going to be able to devote time to this PR in a while ... I'm into a great load of work atm and I don't actually recall the details of this after the time passed ... |
I did some benchmarks. Did run it several times and this is average summary results. ruby 2.3 / derailed bundle:mem
ruby 2.3 / test.rb
ruby 2.3 / bench.rb
ruby 2.4 / derailed bundle:mem
ruby 2.4 / test.rb
ruby 2.4 / bench.rb
ruby 2.4 / test.rb process size
ruby 2.4 is faster and better than 2.3 So. I don't know how it performs in real world. |
This is a rebased PR following up #6.
Current results from
bundle exec derailed bundle:mem
: