File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 14
14
json_string = json_data . to_json
15
15
16
16
i = 0
17
-
17
+ start_time = Time . now
18
18
while true do
19
19
Zstd . compress ( json_string )
20
20
if ( ( i % 1000 ) == 0 )
21
- puts "count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
21
+ puts "sec: #{ Time . now - start_time } \t count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
22
22
end
23
23
i += 1
24
24
end
Original file line number Diff line number Diff line change 16
16
while true do
17
17
Zstd . decompress IO . read ( "./results/#{ sample_file_name } .zstd" )
18
18
if ( ( i % 1000 ) == 0 )
19
- puts "count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
19
+ puts "sec: #{ Time . now - start_time } \t count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
20
20
end
21
21
i += 1
22
22
end
Original file line number Diff line number Diff line change 13
13
json_string = IO . read ( "./samples/#{ sample_file_name } " )
14
14
15
15
i = 0
16
+ start_time = Time . now
16
17
while true do
17
18
stream = Zstd ::StreamingCompress . new
18
19
stream << json_string [ 0 , 5 ]
21
22
res << stream . finish
22
23
if ( ( i % 1000 ) == 0 )
23
24
GC . start
24
- puts "count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
25
+ puts "sec: #{ Time . now - start_time } \t count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
25
26
end
26
27
i += 1
27
28
end
Original file line number Diff line number Diff line change 12
12
13
13
cstr = IO . read ( "./results/#{ sample_file_name } .zstd" )
14
14
i = 0
15
+ start_time = Time . now
15
16
while true do
16
17
stream = Zstd ::StreamingDecompress . new
17
18
result = ''
20
21
21
22
if ( ( i % 1000 ) == 0 )
22
23
GC . start
23
- puts "count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
24
+ puts "sec: #{ Time . now - start_time } \t count :#{ i } \t ruby_memory:#{ ObjectSpace . memsize_of_all /1000 } \t object_count:#{ ObjectSpace . count_objects } \t rss:#{ `ps -o rss= -p #{ Process . pid } ` . to_i } "
24
25
end
25
26
i += 1
26
27
end
You can’t perform that action at this time.
0 commit comments