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 1414json_string = json_data . to_json
1515
1616i = 0
17-
17+ start_time = Time . now
1818while true do
1919 Zstd . compress ( json_string )
2020 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 } "
2222 end
2323 i += 1
2424end
Original file line number Diff line number Diff line change 1616while true do
1717 Zstd . decompress IO . read ( "./results/#{ sample_file_name } .zstd" )
1818 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 } "
2020 end
2121 i += 1
2222end
Original file line number Diff line number Diff line change 1313json_string = IO . read ( "./samples/#{ sample_file_name } " )
1414
1515i = 0
16+ start_time = Time . now
1617while true do
1718 stream = Zstd ::StreamingCompress . new
1819 stream << json_string [ 0 , 5 ]
2122 res << stream . finish
2223 if ( ( i % 1000 ) == 0 )
2324 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 } "
2526 end
2627 i += 1
2728end
Original file line number Diff line number Diff line change 1212
1313cstr = IO . read ( "./results/#{ sample_file_name } .zstd" )
1414i = 0
15+ start_time = Time . now
1516while true do
1617 stream = Zstd ::StreamingDecompress . new
1718 result = ''
2021
2122 if ( ( i % 1000 ) == 0 )
2223 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 } "
2425 end
2526 i += 1
2627end
You can’t perform that action at this time.
0 commit comments