Project

General

Profile

Feature #15899 ยป test_mem.rb

edd314159 (Edd Morgan), 07/09/2019 06:33 PM

 
1
require "memory_profiler"
2

    
3
STRING = "the quick brown fox jumps over the lazy dog"
4
SEP = "fox"
5

    
6
before_report = MemoryProfiler.report do
7
  head = STRING.before(SEP)
8
end
9

    
10
before_report.pretty_print
11

    
12
partition_report = MemoryProfiler.report do
13
  head, _seperator, _tail = STRING.partition(SEP)
14
end
15

    
16
partition_report.pretty_print