|
| 1 | +➜ sql git:(main) ✗ mix sql.bench |
| 2 | +Compiling 2 files (.ex) |
| 3 | +Generated sql app |
| 4 | +Operating System: macOS |
| 5 | +CPU Information: Apple M1 Max |
| 6 | +Number of Available Cores: 10 |
| 7 | +Available memory: 64 GB |
| 8 | +Elixir 1.18.3 |
| 9 | +Erlang 27.3.3 |
| 10 | +JIT enabled: true |
| 11 | + |
| 12 | +Benchmark suite executing with the following configuration: |
| 13 | +warmup: 2 s |
| 14 | +time: 5 s |
| 15 | +memory time: 2 s |
| 16 | +reduction time: 2 s |
| 17 | +parallel: 1 |
| 18 | +inputs: 1..100_000 |
| 19 | +Estimated total run time: 1 min 50 s |
| 20 | + |
| 21 | +Benchmarking comptime ecto with input 1..100_000 ... |
| 22 | +Benchmarking comptime inspect with input 1..100_000 ... |
| 23 | +Benchmarking comptime to_sql with input 1..100_000 ... |
| 24 | +Warning: The function you are trying to benchmark is super fast, making measurements more unreliable! |
| 25 | +This holds especially true for memory measurements or when running with hooks. |
| 26 | + |
| 27 | +See: https://github.com/bencheeorg/benchee/wiki/Benchee-Warnings#fast-execution-warning |
| 28 | + |
| 29 | +You may disable this warning by passing print: [fast_warning: false] as configuration options. |
| 30 | + |
| 31 | +Benchmarking comptime to_string with input 1..100_000 ... |
| 32 | +Benchmarking lex with input 1..100_000 ... |
| 33 | +Benchmarking parse with input 1..100_000 ... |
| 34 | +Benchmarking runtime ecto with input 1..100_000 ... |
| 35 | +Benchmarking runtime inspect with input 1..100_000 ... |
| 36 | +Benchmarking runtime to_sql with input 1..100_000 ... |
| 37 | +Benchmarking runtime to_string with input 1..100_000 ... |
| 38 | +Calculating statistics... |
| 39 | +Formatting results... |
| 40 | + |
| 41 | +##### With input 1..100_000 ##### |
| 42 | +Name ips average deviation median 99th % |
| 43 | +comptime to_sql 56.19 M 17.80 ns ±30972.30% 12.50 ns 25 ns |
| 44 | +runtime to_string 21.31 M 46.92 ns ±42710.84% 42 ns 42 ns |
| 45 | +comptime to_string 21.15 M 47.29 ns ±42658.18% 42 ns 42 ns |
| 46 | +runtime to_sql 20.52 M 48.73 ns ±55380.53% 42 ns 42 ns |
| 47 | +comptime inspect 6.84 M 146.11 ns ±21283.47% 125 ns 208 ns |
| 48 | +runtime inspect 6.83 M 146.34 ns ±21773.59% 125 ns 167 ns |
| 49 | +parse 1.35 M 741.51 ns ±2669.75% 667 ns 834 ns |
| 50 | +lex 0.23 M 4286.10 ns ±223.26% 4167 ns 4791 ns |
| 51 | +comptime ecto 0.21 M 4809.84 ns ±205.20% 4625 ns 6292 ns |
| 52 | +runtime ecto 0.195 M 5117.91 ns ±163.26% 4917 ns 7167 ns |
| 53 | + |
| 54 | +Comparison: |
| 55 | +comptime to_sql 56.19 M |
| 56 | +runtime to_string 21.31 M - 2.64x slower +29.13 ns |
| 57 | +comptime to_string 21.15 M - 2.66x slower +29.49 ns |
| 58 | +runtime to_sql 20.52 M - 2.74x slower +30.94 ns |
| 59 | +comptime inspect 6.84 M - 8.21x slower +128.31 ns |
| 60 | +runtime inspect 6.83 M - 8.22x slower +128.54 ns |
| 61 | +parse 1.35 M - 41.67x slower +723.72 ns |
| 62 | +lex 0.23 M - 240.84x slower +4268.30 ns |
| 63 | +comptime ecto 0.21 M - 270.27x slower +4792.05 ns |
| 64 | +runtime ecto 0.195 M - 287.58x slower +5100.11 ns |
| 65 | + |
| 66 | +Memory usage statistics: |
| 67 | + |
| 68 | +Name Memory usage |
| 69 | +comptime to_sql 24 B |
| 70 | +runtime to_string 0 B - 0.00x memory usage -24 B |
| 71 | +comptime to_string 0 B - 0.00x memory usage -24 B |
| 72 | +runtime to_sql 24 B - 1.00x memory usage +0 B |
| 73 | +comptime inspect 280 B - 11.67x memory usage +256 B |
| 74 | +runtime inspect 280 B - 11.67x memory usage +256 B |
| 75 | +parse 2736 B - 114.00x memory usage +2712 B |
| 76 | +lex 11984 B - 499.33x memory usage +11960 B |
| 77 | +comptime ecto 18848 B - 785.33x memory usage +18824 B |
| 78 | +runtime ecto 21336 B - 889.00x memory usage +21312 B |
| 79 | + |
| 80 | +**All measurements for memory usage were the same** |
| 81 | + |
| 82 | +Reduction count statistics: |
| 83 | + |
| 84 | +Name Reduction count |
| 85 | +comptime to_sql 2 |
| 86 | +runtime to_string 7 - 3.50x reduction count +5 |
| 87 | +comptime to_string 7 - 3.50x reduction count +5 |
| 88 | +runtime to_sql 2 - 1.00x reduction count +0 |
| 89 | +comptime inspect 28 - 14.00x reduction count +26 |
| 90 | +runtime inspect 28 - 14.00x reduction count +26 |
| 91 | +parse 255 - 127.50x reduction count +253 |
| 92 | +lex 154 - 77.00x reduction count +152 |
| 93 | +comptime ecto 1132 - 566.00x reduction count +1130 |
| 94 | +runtime ecto 1193 - 596.50x reduction count +1191 |
| 95 | + |
| 96 | +**All measurements for reduction count were the same** |
0 commit comments