minting 1.1.1 → 1.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +43 -5
  3. data/Rakefile +5 -7
  4. data/lib/minting/version.rb +1 -1
  5. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef2574a0bffcbccb882faba1a839ef37369e047b23becf1ce405d2c1b883322a
4
- data.tar.gz: 19ec197c01ceb083a2f6dcf2c6898b38f80ba7679749154b74b3d9fb2f2ffeda
3
+ metadata.gz: 9506e71f742812607fef378d4df90eaea6d2457f0d818b55b6e06b6167fa6876
4
+ data.tar.gz: 99b200de879dfb9ed4eaec21b02067a886c01d48116fcb669ca70b5dbf314264
5
5
  SHA512:
6
- metadata.gz: e8680da52ba5417cbe89f2c36615247fa1cc7302088c7d087aa782b6d1958bcd124a38f2b1027cd164810f9f04b02974cf8ac68cb61047d204c9189bf1943a6d
7
- data.tar.gz: e85e786f6cb1f98b10e75742097651013e9fe57ddad4896a70fd85b836709e2eecfe26d0f0854b05423f931b1b5fc17b46dfa63c0e25f1a86ffa024de3748d05
6
+ metadata.gz: 01b120551584f7f6327f2db19731367dd091bfb3e7b9db91d98cd2ff0b7e1db41d4c190acc66d8cd611fe7689ddb8872b89bebe9db6506e267df121c60fbe6f1
7
+ data.tar.gz: 8cc6a7ffc780a555276298432de7c2929c5ffddadc4fc28b379a8c58245b70672a777e610e464b6ea485583a8b65eb7463b37e29ff422b9e065ecd1f565cb85a
data/README.md CHANGED
@@ -192,11 +192,6 @@ This gem includes a performance suite under `test/performance`:
192
192
  - Memory and GC pressure tests
193
193
  - Competitive benchmarks vs `money` gem
194
194
 
195
- On a typical machine, reference numbers are:
196
-
197
- - Money creation: ~1.6M ops/sec
198
- - Addition: ~1.7M ops/sec
199
-
200
195
  Run locally:
201
196
 
202
197
  ```bash
@@ -210,6 +205,49 @@ BENCH=true rake bench:competitive
210
205
  rake bench:regression
211
206
  ```
212
207
 
208
+ ## Benchmark Summary: Minting vs Money Gem
209
+
210
+ Generated by Qwen from the latest benchmark run on Ruby 4.0.1. - 2026-05-30
211
+
212
+ ### Key Takeaways
213
+
214
+ - **Mint is consistently faster** than the Money gem across all measured operations.
215
+ - **Mint is 2.28x faster** in the 50,000-transaction simulation.
216
+ - **Mint object creation is 2.76x faster** than `Money.from_amount`.
217
+ - In formatting and conversion, Mint is often **10+x **.
218
+ - Mint’s performance advantage is especially strong for numeric conversion, string formatting, comparisons, and high-volume transaction loops.
219
+
220
+ ### Performance Highlights
221
+
222
+ | Category | Mint | Money | Approx. Ratio |
223
+ | --- | --- | --- | --- |
224
+ | High-volume transactions | 195,412 ops/sec | 85,882 ops/sec | 2.28x faster |
225
+ | `Mint.money` creation | 1.14M ops/sec | — | 2.76x faster than `Money.from_amount` |
226
+ | `some.dollars` creation | 990k ops/sec | — | 1.15x faster than `Mint.money` |
227
+ | `Money.new` creation | — | 715k ops/sec | Mint 1.59x faster |
228
+ | `to_f` formatting | 8.8M–9.3M ops/sec | 0.7M ops/sec | ~12x faster |
229
+ | `to_d` conversion | 2.1M–2.3M ops/sec | 0.73M–0.79M ops/sec | ~3x faster |
230
+ | `to_s` formatting | 300k–420k ops/sec | 109k–132k ops/sec | ~3x faster |
231
+ | `inspect` formatting | ~2.6–2.9M ops/sec | ~1.1–1.16M ops/sec | ~2.5x faster |
232
+ | `to_json` formatting | ~2.0–2.2M ops/sec | ~110k–126k ops/sec | ~17x faster |
233
+ | Currency lookup `Mint.currency('USD')` | 3.82M ops/sec | — | 1.60x faster than `Money::Currency.new` |
234
+ | Currency lookup `Money::Currency.find('USD')` | 3.63M ops/sec | 1.67M ops/sec | 2.29x faster |
235
+ | Addition | 1.11M ops/sec | 0.37M ops/sec | 3.0x faster |
236
+ | Subtraction | 1.11M ops/sec | 0.36M ops/sec | 3.0x faster |
237
+ | Multiplication | 1.28M ops/sec | 0.51M ops/sec | 2.5x faster |
238
+ | Division | 1.04M ops/sec | 0.37M ops/sec | 2.8x faster |
239
+ | Ratio division | 2.94M ops/sec | 0.39M ops/sec | 7.6x faster |
240
+ | Comparison (`==`, `<`, `>`) | 2.5M–4.1M ops/sec | 0.35M–0.38M ops/sec | 7x–10x faster |
241
+ | Allocation (`Mint.allocate`) | 279k ops/sec | 146k ops/sec | 1.9x faster |
242
+ | Split (`Mint.split`) | 215k ops/sec | 85k ops/sec | 3.3x faster |
243
+
244
+ ### Commands Used
245
+
246
+ ```sh
247
+ BENCH=true bundle exec ruby -Ilib:test -r ./test/test_helper.rb test/performance/competitive_performance_benchmark.rb
248
+ BENCH=true bundle exec ruby -Ilib:test -r ./test/test_helper.rb test/performance/competitive_memory_benchmark.rb
249
+ ```
250
+
213
251
  ## License
214
252
 
215
253
  MIT
data/Rakefile CHANGED
@@ -14,16 +14,16 @@ end
14
14
 
15
15
  Rake::TestTask.new(:bench) do |t|
16
16
  t.libs = %w[lib test]
17
- t.pattern = 'test/**/*_benchmark.rb'
17
+ t.pattern = 'test/performance/*_benchmark.rb'
18
18
  end
19
19
 
20
- # Performance benchmark tasks
21
- Rake::TestTask.new('bench:performance') do |t|
20
+ Rake::TestTask.new('bench:edge') do |t|
22
21
  t.libs = %w[lib test]
23
- t.pattern = 'test/performance/*_benchmark.rb'
22
+ t.pattern = 'test/performance/algorithm_benchmark.rb'
24
23
  t.ruby_opts << '-r test_helper.rb'
25
24
  end
26
25
 
26
+
27
27
  Rake::TestTask.new('bench:regression') do |t|
28
28
  t.libs = %w[lib test]
29
29
  t.pattern = 'test/performance/regression_benchmark.rb'
@@ -32,12 +32,10 @@ end
32
32
 
33
33
  Rake::TestTask.new('bench:competitive') do |t|
34
34
  t.libs = %w[lib test]
35
- t.pattern = 'test/performance/competitive_benchmark.rb'
35
+ t.pattern = 'test/performance/competitive_performance_benchmark.rb'
36
36
  t.ruby_opts << '-r test_helper.rb'
37
37
  end
38
38
 
39
- task 'bench:all' => ['bench', 'bench:performance']
40
-
41
39
  RuboCop::RakeTask.new(:cop)
42
40
 
43
41
  YARD::Rake::YardocTask.new do |t|
@@ -1,5 +1,5 @@
1
1
  # Root namespace for the Minting library.
2
2
  module Minting
3
3
  # Current version of the Minting gem.
4
- VERSION = '1.1.1'.freeze
4
+ VERSION = '1.1.2'.freeze
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minting
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gilson Ferraz