Skip to content

Commit 209e8e4

Browse files
committed
Update changelog and benchmarks
1 parent 83444d7 commit 209e8e4

File tree

2 files changed

+33
-37
lines changed

2 files changed

+33
-37
lines changed

CHANGELOG.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
# Changelog
77

8-
## v0.2.0 (TBA)
8+
## v0.2.0 (2025-05-04)
99

1010
### Enhancement
1111
- SQL 2016 conformance [#6](https://github.com/elixir-dbvisor/sql/pull/6).
@@ -15,12 +15,12 @@
1515
- MySQL adapter [#5](https://github.com/elixir-dbvisor/sql/pull/5).
1616
- PostgreSQL adapter [#5](https://github.com/elixir-dbvisor/sql/pull/5).
1717
- TDS adapter [#5](https://github.com/elixir-dbvisor/sql/pull/5).
18-
- Improve SQL generation with 4-600x compared to Ecto [#7](https://github.com/elixir-dbvisor/sql/pull/7).
19-
- Ensure inspect follows the standard [representation](https://hexdocs.pm/elixir/Inspect.html#module-inspect-representation) [#4](https://github.com/elixir-dbvisor/sql/pull/4)
18+
- Improve SQL generation with 57-344x compared to Ecto [#7](https://github.com/elixir-dbvisor/sql/pull/7) [#4](https://github.com/elixir-dbvisor/sql/pull/4).
19+
- Ensure inspect follows the standard [representation](https://hexdocs.pm/elixir/Inspect.html#module-inspect-representation) [#4](https://github.com/elixir-dbvisor/sql/pull/4).
20+
- Ensure storage is setup when running benchmarks [#5](https://github.com/elixir-dbvisor/sql/pull/5).
2021

2122
### Deprecation
22-
- token_to_sql/2 is deprecated in favor of SQL.Token behaviour token_to_string/2 [#5](https://github.com/elixir-dbvisor/sql/pull/5).
23-
23+
- token_to_sql/2 is deprecated in favor of SQL.Token behaviour token_to_string/2 [#11](https://github.com/elixir-dbvisor/sql/pull/11).
2424

2525
## v0.1.0 (2025-03-01)
2626

benchmarks/v0.2.0.md

+28-32
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
➜ sql git:(optimize-sql-generation) ✗ mix sql.bench
2-
Compiling 1 file (.ex)
3-
Generated sql app
1+
➜ sql git:(main) ✗ mix sql.bench
42
Operating System: macOS
53
CPU Information: Apple M1 Max
64
Number of Available Cores: 10
@@ -18,38 +16,36 @@ parallel: 1
1816
inputs: none specified
1917
Estimated total run time: 56 s
2018

21-
Benchmarking Ecto.Repo.to_sql ...
19+
Benchmarking ecto ...
2220
Benchmarking inspect ...
2321
Benchmarking to_sql ...
2422
Benchmarking to_string ...
2523
Calculating statistics...
2624
Formatting results...
2725

28-
Name ips average deviation median 99th %
29-
to_sql 4.74 K 0.21 ms ±20.20% 0.20 ms 0.32 ms
30-
to_string 4.51 K 0.22 ms ±3.60% 0.22 ms 0.26 ms
31-
inspect 0.24 K 4.09 ms ±2.96% 4.09 ms 4.36 ms
32-
Ecto.Repo.to_sql 0.00757 K 132.03 ms ±1.45% 131.80 ms 139.43 ms
26+
Name ips average deviation median 99th %
27+
to_sql 2.66 K 0.38 ms ±2.66% 0.37 ms 0.42 ms
28+
to_string 1.75 K 0.57 ms ±31.77% 0.47 ms 1.10 ms
29+
inspect 0.25 K 3.94 ms ±4.64% 3.91 ms 4.35 ms
30+
ecto 0.00772 K 129.54 ms ±1.20% 129.14 ms 132.51 ms
3331

3432
Comparison:
35-
to_sql 4.74 K
36-
to_string 4.51 K - 1.05x slower +0.0108 ms
37-
inspect 0.24 K - 19.39x slower +3.88 ms
38-
Ecto.Repo.to_sql 0.00757 K - 626.20x slower +131.82 ms
33+
to_sql 2.66 K
34+
to_string 1.75 K - 1.52x slower +0.196 ms
35+
inspect 0.25 K - 10.47x slower +3.56 ms
36+
ecto 0.00772 K - 344.27x slower +129.16 ms
3937

4038
Memory usage statistics:
4139

42-
Name Memory usage
43-
to_sql 0.38 MB
44-
to_string 0.153 MB - 0.40x memory usage -0.22888 MB
45-
inspect 4.88 MB - 12.80x memory usage +4.50 MB
46-
Ecto.Repo.to_sql 179.35 MB - 470.13x memory usage +178.97 MB
40+
Name Memory usage
41+
to_sql 0.69 MB
42+
to_string 0.46 MB - 0.67x memory usage -0.22888 MB
43+
inspect 6.71 MB - 9.78x memory usage +6.03 MB
44+
ecto 179.35 MB - 261.19x memory usage +178.67 MB
4745

4846
**All measurements for memory usage were the same**
4947

5048
➜ sql git:(optimize-sql-generation) ✗ mix sql.bench
51-
Compiling 1 file (.ex)
52-
Generated sql app
5349
Operating System: macOS
5450
CPU Information: Apple M1 Max
5551
Number of Available Cores: 10
@@ -75,23 +71,23 @@ Calculating statistics...
7571
Formatting results...
7672

7773
Name ips average deviation median 99th %
78-
to_string 27.59 36.24 ms ±0.75% 36.22 ms 37.21 ms
79-
to_sql 27.45 36.42 ms ±0.47% 36.39 ms 36.93 ms
80-
inspect 24.53 40.76 ms ±1.07% 40.75 ms 41.60 ms
81-
ecto 6.96 143.65 ms ±1.37% 143.36 ms 148.62 ms
74+
to_sql 394.70 2.53 ms ±3.88% 2.51 ms 2.82 ms
75+
to_string 391.12 2.56 ms ±1.82% 2.55 ms 2.70 ms
76+
inspect 132.40 7.55 ms ±6.37% 7.69 ms 8.44 ms
77+
ecto 6.89 145.10 ms ±1.22% 144.41 ms 149.21 ms
8278

8379
Comparison:
84-
to_string 27.59
85-
to_sql 27.45 - 1.00x slower +0.181 ms
86-
inspect 24.53 - 1.12x slower +4.52 ms
87-
ecto 6.96 - 3.96x slower +107.41 ms
80+
to_sql 394.70
81+
to_string 391.12 - 1.01x slower +0.0232 ms
82+
inspect 132.40 - 2.98x slower +5.02 ms
83+
ecto 6.89 - 57.27x slower +142.56 ms
8884

8985
Memory usage statistics:
9086

9187
Name Memory usage
92-
to_string 4.50 MB
93-
to_sql 4.73 MB - 1.05x memory usage +0.23 MB
94-
inspect 9.23 MB - 2.05x memory usage +4.73 MB
95-
ecto 202.87 MB - 45.11x memory usage +198.37 MB
88+
to_sql 4.35 MB
89+
to_string 4.12 MB - 0.95x memory usage -0.22913 MB
90+
inspect 10.37 MB - 2.39x memory usage +6.03 MB
91+
ecto 202.87 MB - 46.67x memory usage +198.52 MB
9692

9793
**All measurements for memory usage were the same**

0 commit comments

Comments
 (0)