forked from spajic/task-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
start.rb
27 lines (20 loc) · 818 Bytes
/
start.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require './spec/spec_helper'
require_relative './task-1'
require 'benchmark/ips'
require 'ruby-prof'
RubyProf.measure_mode = RubyProf::ALLOCATIONS
# RubyProf.measure_mode = RubyProf::MEMORY
result = RubyProf.profile do
work('./spec/fixtures/data_medium-10k.txt')
end
# printer = RubyProf::FlatPrinter.new(result)
# printer.print(File.open("ruby_prof_flat_allocations_profile.txt", "w+"))
# printer = RubyProf::DotPrinter.new(result)
# printer.print(File.open("ruby_prof_allocations_profile.dot", "w+"))
printer = RubyProf::GraphHtmlPrinter.new(result)
printer.print(File.open("ruby_prof_graph_allocations_profile.html", "w+"))
result = RubyProf.profile do
work('./spec/fixtures/data_medium-10k.txt')
end
# printer = RubyProf::CallTreePrinter.new(result)
# printer.print(:path => ".", :profile => 'profile')