Files
simdjson-simdjson/scripts/ruby/kostya_large.rb
T
2019-12-30 15:07:42 -05:00

18 lines
351 B
Ruby
Executable File

#!/usr/bin/env ruby
require 'json'
x = []
524288.times do
h = {
'x' => rand,
'y' => rand,
'z' => rand,
'name' => ('a'..'z').to_a.shuffle[0..5].join + ' ' + rand(10000).to_s,
'opts' => {'1' => [1, true]},
}
x << h
end
File.open("1.json", 'w') { |f| f.write JSON.pretty_generate('coordinates' => x, 'info' => "some info") }