diff --git a/README.md b/README.md index 9201396a..d69616c3 100644 --- a/README.md +++ b/README.md @@ -340,20 +340,24 @@ All backends must have the following functions: - `inject(string)` Inject a (usually cached) string into the output; instering any delimiters as needed. - `capture(&block)` Capture the output of the block (w/o any delimiters) -Benchmark ---------- -`gnuplot` is required to run benchmark, to install: -- `brew install gnuplot` (MacOS) +Performance Benchmarks +---------------------- -`yajl` is required to install a development dependency [`wankel`](https://github.com/malomalo/wankel), to install: -- `brew install yajl` (MacOS) +[Gnuplot](http://www.gnuplot.info) and [YAJL](http://lloyd.github.io/yajl/) are +required to run the benchmarks. To install: -To run benchmark: `bundle exec rake performance` +- `brew install gnuplot yajl` (MacOS) + +To run the benchmarks run: `bundle exec rake performance` This will produce 2 graph images on in folders - `performance/dirk` - `performance/rolftimmermans` +The reports below were generated on macOS 10.14.6 Mac mini with a 3.2 Ghz Intel Core i7: + +dirkrolftimmermans + Special Thanks & Contributors ----------------------------- diff --git a/performance/dirk/rabl/oj.rb b/performance/dirk/rabl/oj.rb index f2acac43..41226c99 100644 --- a/performance/dirk/rabl/oj.rb +++ b/performance/dirk/rabl/oj.rb @@ -7,20 +7,13 @@ def self.cache end end +VIEW_PATH = File.expand_path("../performance/dirk/rabl/views/", __FILE__) +SOURCE = File.read(File.join(VIEW_PATH, "template.rabl")) + # Fill the cache -Rabl.render( - nil, - "template", - view_path: File.expand_path("../performance/dirk/rabl/views/", __FILE__), - format: :json, -) +Rabl::Renderer.new(SOURCE, nil, {format: :json}).render # Everthing before this is run once initially, after is the test __SETUP__ -Rabl.render( - nil, - "template", - view_path: File.expand_path("../performance/dirk/rabl/views/", __FILE__), - format: :json, -) +Rabl::Renderer.new(SOURCE, nil, {format: :json}).render \ No newline at end of file diff --git a/performance/dirk/report.png b/performance/dirk/report.png new file mode 100644 index 00000000..b358faa8 Binary files /dev/null and b/performance/dirk/report.png differ diff --git a/performance/rolftimmermans/report.png b/performance/rolftimmermans/report.png new file mode 100644 index 00000000..8dd5eb9a Binary files /dev/null and b/performance/rolftimmermans/report.png differ diff --git a/turbostreamer.gemspec b/turbostreamer.gemspec index de4159e8..0f328739 100644 --- a/turbostreamer.gemspec +++ b/turbostreamer.gemspec @@ -33,7 +33,6 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'analyzer' spec.add_development_dependency 'jbuilder' spec.add_development_dependency 'rabl' - # For running benchmark spec.add_development_dependency 'multi_json' # spec.add_development_dependency 'sdoc', '~> 0.4' # spec.add_development_dependency 'sdoc-templates-42floors', '~> 0.3'