Memory optimization

This commit is contained in:
Jaiden Mispy 2014-10-16 03:02:39 -07:00
parent d09d968915
commit b7f67ec0a6
8 changed files with 203990 additions and 38 deletions

203945
spec/data/0xabad1dea.json Normal file

File diff suppressed because it is too large Load diff

Binary file not shown.

View file

@ -1,8 +1,14 @@
require 'spec_helper'
require 'objspace'
require 'memory_profiler'
describe Ebooks::Model do
it "does stuff" do
model = Ebooks::Model.load(path("data/0xabad1dea.model"))
it "does not use a ridiculous amount of memory" do
RubyProf.start
Ebooks::Model.consume(path("data/0xabad1dea.json"))
result = RubyProf.stop
require 'pry'; binding.pry
expect(report.total_retained).to be < 100000
end
end