Skip to content

Commit

Permalink
Make sure data is created before running the query
Browse files Browse the repository at this point in the history
  • Loading branch information
rmosolgo committed Feb 22, 2023
1 parent 988a602 commit 7085e51
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions benchmark/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,20 +203,26 @@ def self.profile_large_result

module ProfileLargeResult
DATA = 1000.times.map {
-> {
{
h = {
id: SecureRandom.uuid,
int1: SecureRandom.random_number(100000),
int2: SecureRandom.random_number(100000),
string1: -> { SecureRandom.base64 },
string1: (d = SecureRandom.base64; -> { d }),
string2: SecureRandom.base64,
boolean1: SecureRandom.random_number(1) == 0,
boolean2: SecureRandom.random_number(1) == 0,
int_array: -> { 10.times.map { -> { SecureRandom.random_number(100000) } } },
int_array: (
a = [];
10.times.map {
n = SecureRandom.random_number(100000)
a << -> { n }
};
-> { a }
),
string_array: 10.times.map { SecureRandom.base64 },
boolean_array: 10.times.map { SecureRandom.random_number(1) == 0 },
}
}
-> { h }
}

module Bar
Expand Down

0 comments on commit 7085e51

Please sign in to comment.