Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add benchmark script #13

Merged
merged 1 commit into from
Mar 16, 2024
Merged

Add benchmark script #13

merged 1 commit into from
Mar 16, 2024

Conversation

pocke
Copy link
Owner

@pocke pocke commented Mar 16, 2024

The current benchmarking result is the following:

# Benchmarking #to_sql mehtod

## Wihtout AR::Originator
ruby benchmark/to_sql.rb
-- create_table(:posts, {:force=>true})
   -> 0.0061s
ruby 3.4.0dev (2024-02-06T03:19:56Z master 4f6b827e98) [arm64-darwin21]
Warming up --------------------------------------
       without where     5.921k i/100ms
with single condition
                         2.714k i/100ms
with multiple condition
                         1.517k i/100ms
Calculating -------------------------------------
       without where     59.719k (± 0.7%) i/s -    301.971k in   5.056838s
with single condition
                         27.049k (± 0.9%) i/s -    135.700k in   5.017249s
with multiple condition
                         15.021k (± 1.8%) i/s -     75.850k in   5.051172s

## With AR::Originator
ruby -r activerecord/originator benchmark/to_sql.rb
-- create_table(:posts, {:force=>true})
   -> 0.0046s
ruby 3.4.0dev (2024-02-06T03:19:56Z master 4f6b827e98) [arm64-darwin21]
Warming up --------------------------------------
       without where     1.116k i/100ms
with single condition
                       543.000 i/100ms
with multiple condition
                       269.000 i/100ms
Calculating -------------------------------------
       without where     11.178k (± 0.8%) i/s -     56.916k in   5.092079s
with single condition
                          5.512k (± 1.5%) i/s -     27.693k in   5.025152s
with multiple condition
                          2.635k (± 4.6%) i/s -     13.181k in   5.012587s
# Benchmarking SELECT Query

## Wihtout AR::Originator
ruby benchmark/select_query.rb
-- create_table(:posts, {:force=>true})
   -> 0.0048s
ruby 3.4.0dev (2024-02-06T03:19:56Z master 4f6b827e98) [arm64-darwin21]
Warming up --------------------------------------
       without where     5.911k i/100ms
with single condition
                         2.717k i/100ms
with multiple condition
                         1.522k i/100ms
Calculating -------------------------------------
       without where     58.395k (± 2.5%) i/s -    295.550k in   5.064565s
with single condition
                         26.948k (± 1.8%) i/s -    135.850k in   5.042894s
with multiple condition
                         15.208k (± 0.7%) i/s -     76.100k in   5.004290s

## With AR::Originator
ruby -r activerecord/originator benchmark/select_query.rb
-- create_table(:posts, {:force=>true})
   -> 0.0050s
ruby 3.4.0dev (2024-02-06T03:19:56Z master 4f6b827e98) [arm64-darwin21]
Warming up --------------------------------------
       without where     1.135k i/100ms
with single condition
                       556.000 i/100ms
with multiple condition
                       288.000 i/100ms
Calculating -------------------------------------
       without where     11.413k (± 2.0%) i/s -     57.885k in   5.074069s
with single condition
                          5.490k (± 2.1%) i/s -     27.800k in   5.066375s
with multiple condition
                          2.869k (± 2.6%) i/s -     14.400k in   5.023409s

@pocke pocke merged commit 830d020 into master Mar 16, 2024
4 checks passed
@pocke pocke deleted the Add_benchmark_script branch March 16, 2024 09:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant