type_balancer 0.1.0 → 0.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9d017bcd987973e61c2cca2f30f3a968ebccc0604b7043e44fd7ca4aa22a57a2
4
- data.tar.gz: 214815b85a1095b6c4b9b853c6154b3c919d4671db2c69a6730ca21dcad5c559
3
+ metadata.gz: f73ec86fddfda3cd22f19b0081824a8a488e1a47359976e32eb6b999074b92a3
4
+ data.tar.gz: f25f85b6caeeeb3a5f8012ae295b96ae02413e4b4342aba946438bbcbb9eb063
5
5
  SHA512:
6
- metadata.gz: c8e8dd1cd9854f80d68a54475e13634bb2ca2e78350f9fe4994252a502bd7acd75d764f7a7c0bd779808ebf39ba496289efa50f8bc7a281391d9e11d3a8ab500
7
- data.tar.gz: fbcec72c85c4480f6b035f07bc8f49311798b90dd14c6eaf8cf4a7054c8ec2e7ded4ef9d1dd08e9029a5ce2f698696054f9f96191fae5f88461ad5d303aa10c8
6
+ metadata.gz: c8895eea255feccab33cd33ba70d9bfb486a4ff9108ba1a828d1be72b501db1635cb35d5aab574298923533d1080c29d7b45a50bb8d1547ffdacfd882dc4d491
7
+ data.tar.gz: '09f755338981a1523cae4eddc3468b17d7693b9183e7039b7e81f1d24bd6beab29133d9d9a797487ea3745195f3f4e577311c89258b41fa237bd63cc3fb63cd2'
data/.DS_Store ADDED
Binary file
data/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
- ## [Unreleased]
1
+ # Changelog
2
2
 
3
- ## [0.1.0] - 2025-03-29
3
+ ## [0.1.2] - 2024-04-11
4
4
 
5
- - Initial release
5
+ - Re-release of 0.1.1 due to RubyGems.org publishing issue
6
+ - No functional changes from 0.1.1
7
+
8
+ ## [0.1.1] - 2024-03-XX
9
+
10
+ ### Refactoring
11
+ - Major refactoring of core components to follow SOLID principles:
12
+ - Extracted core functionality into separate modules for better separation of concerns
13
+ - Split balancer logic into `batch_processing`, `ratio_calculator`, and `type_extractor` modules
14
+ - Improved error handling and type management
15
+ - Enhanced position calculator with better edge case handling
16
+
17
+ ### Documentation
18
+ - Added comprehensive project description and use cases to README
19
+ - Updated performance metrics with accurate benchmarks
20
+ - Improved contribution guidelines
21
+ - Enhanced quality script documentation
22
+
23
+ ### Performance
24
+ - Updated benchmark results showing significant improvements:
25
+ - Tiny collections (10 items): 6-10μs
26
+ - Small collections (100 items): 30-52μs
27
+ - Medium collections (1,000 items): 274-555μs
28
+ - Large collections (10,000 items): 2.4-4.5ms
29
+
30
+ ### Fixed
31
+ - Position calculator edge cases and quality checks
32
+ - RSpec test failures related to type extraction
33
+ - Custom type order handling in balancer implementation
34
+
35
+ ## [0.1.0] - Initial Release
36
+
37
+ - Initial release of TypeBalancer
38
+ - Core functionality for balancing collections by type
39
+ - Basic documentation and tests
data/Dockerfile CHANGED
@@ -13,6 +13,9 @@ RUN apt-get update && apt-get install -y \
13
13
 
14
14
  # Install Rust if YJIT is enabled
15
15
  ARG ENABLE_YJIT=false
16
+ ARG RUBY_YJIT_ENABLE=0
17
+ ENV RUBY_YJIT_ENABLE=${RUBY_YJIT_ENABLE}
18
+
16
19
  RUN if [ "${ENABLE_YJIT}" = "true" ]; then \
17
20
  curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y; \
18
21
  fi
@@ -22,7 +25,6 @@ WORKDIR /app
22
25
  # Copy all necessary files for building the gem
23
26
  COPY Gemfile Gemfile.lock type_balancer.gemspec Rakefile ./
24
27
  COPY lib/ lib/
25
- COPY sig/ sig/
26
28
  COPY benchmark/ benchmark/
27
29
 
28
30
  # Initialize Git repository and stage files (needed for gemspec)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- type_balancer (0.1.0)
4
+ type_balancer (0.1.3)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -2,12 +2,25 @@
2
2
 
3
3
  # TypeBalancer
4
4
 
5
- [![Gem Version](https://badge.fury.io/rb/type_balancer.svg)](https://badge.fury.io/rb/type_balancer)
5
+ [![Gem Version](https://badge.fury.io/rb/type_balancer.svg)](https://rubygems.org/gems/type_balancer)
6
6
  [![CI](https://github.com/llwebconsulting/type_balancer/actions/workflows/ci.yml/badge.svg)](https://github.com/llwebconsulting/type_balancer/actions/workflows/ci.yml)
7
7
  [![Ruby Coverage](https://img.shields.io/badge/ruby--coverage-78.57%25-yellow.svg)](https://github.com/llwebconsulting/type_balancer/blob/main/coverage/index.html)
8
8
  [![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.txt)
9
9
 
10
- A Ruby gem for balancing and distributing items of different types across a sequence while maintaining optimal spacing.
10
+ Imagine you have a collection of items—like blog posts—that each belong to a specific type: Articles, Images, and Videos. Typically, articles heavily outnumber the other types, which means users often have to scroll past dozens of articles before encountering a video or image. Not an ideal experience.
11
+
12
+ TypeBalancer solves this by intelligently mixing your collection based on type. You simply pass it your collection and the name of the type field, and it ensures that Images and Videos are evenly distributed alongside Articles right at the top of your feed. This way, your users get a more varied and engaging experience from the moment they start scrolling.
13
+
14
+ TypeBalancer is a sophisticated Ruby gem designed to solve the challenge of distributing different types of content across a sequence while maintaining optimal spacing and ratios. It's particularly useful for:
15
+
16
+ - **Content Management Systems**: Ensure a balanced mix of content types (videos, articles, images) in feeds
17
+ - **E-commerce**: Distribute different product categories evenly across search results
18
+ - **News Feeds**: Balance different news categories while maintaining relevance
19
+ - **Recommendation Systems**: Mix various content types while preserving user preferences
20
+
21
+ The gem uses advanced distribution algorithms to ensure that items are not only balanced by type but also maintain optimal spacing, preventing clusters of similar content while respecting specified ratios.
22
+
23
+ [View Documentation](docs/README.md) | [View Benchmark Results](docs/benchmarks/README.md)
11
24
 
12
25
  ## Installation
13
26
 
@@ -43,16 +56,70 @@ items = [
43
56
  balanced_items = TypeBalancer.balance(items, type_field: :type)
44
57
  ```
45
58
 
59
+ ## Balancing Collections with `TypeBalancer.balance`
60
+
61
+ The primary method for balancing collections is `TypeBalancer.balance`. This method takes an array of items and distributes them by type, ensuring optimal spacing and respecting type ratios.
62
+
63
+ **Basic Example:**
64
+
65
+ ```ruby
66
+ items = [
67
+ { type: 'video', title: 'Video 1' },
68
+ { type: 'image', title: 'Image 1' },
69
+ { type: 'article', title: 'Article 1' },
70
+ # ...
71
+ ]
72
+ balanced = TypeBalancer.balance(items, type_field: :type)
73
+ # => [ { type: 'article', ... }, { type: 'image', ... }, { type: 'video', ... }, ... ]
74
+ ```
75
+
76
+ **Custom Type Order:**
77
+
78
+ You can specify a custom order for types using the `type_order` argument. This controls the priority of types in the balanced output.
79
+
80
+ ```ruby
81
+ # Prioritize images, then videos, then articles
82
+ balanced = TypeBalancer.balance(items, type_field: :type, type_order: %w[image video article])
83
+ # => [ { type: 'image', ... }, { type: 'video', ... }, { type: 'article', ... }, ... ]
84
+ ```
85
+
86
+ - `type_field`: The key to use for type extraction (default: `:type`).
87
+ - `type_order`: An array of type names (as strings) specifying the desired order.
88
+
89
+ For more advanced usage and options, see [Detailed Balance Method Documentation](docs/balance.md).
90
+
91
+ ## Calculating Positions Directly
92
+
93
+ In addition to balancing collections, you can use `TypeBalancer.calculate_positions` to determine optimal positions for a given type or subset of items within a sequence. This is useful for advanced scenarios where you need fine-grained control over item placement.
94
+
95
+ **Basic Example:**
96
+
97
+ ```ruby
98
+ # Calculate positions for 3 items in a sequence of 10 slots
99
+ positions = TypeBalancer.calculate_positions(total_count: 10, ratio: 0.3)
100
+ # => [0, 5, 9]
101
+ ```
102
+
103
+ **With Available Items:**
104
+
105
+ ```ruby
106
+ # Restrict placement to specific slots
107
+ positions = TypeBalancer.calculate_positions(total_count: 10, ratio: 0.5, available_items: [0, 1, 2])
108
+ # => [0, 1, 2]
109
+ ```
110
+
111
+ For more advanced usage and options, see [Detailed Position Calculation Documentation](docs/calculate_positions.md).
112
+
46
113
  ## Performance Characteristics
47
114
 
48
115
  TypeBalancer is designed to handle collections of varying sizes efficiently. Here are the current performance metrics:
49
116
 
50
- - Tiny collections (10 items): Microsecond-level processing (9-14μs)
51
- - Small collections (100 items): Sub-millisecond processing (~450-500μs)
52
- - Medium collections (1,000 items): Fast processing (~20-21ms)
53
- - Large collections (10,000 items): Efficient processing (~193-209ms)
117
+ - Tiny collections (10 items): Microsecond-level processing (6-10μs)
118
+ - Small collections (100 items): Sub-millisecond processing (30-52μs)
119
+ - Medium collections (1,000 items): Fast processing (274-555μs)
120
+ - Large collections (10,000 items): Efficient processing (2.4-4.5ms)
54
121
 
55
- Performance has been thoroughly tested across Ruby versions (3.2.8, 3.3.7, and 3.4.2). YJIT provides significant improvements for small datasets (up to 51% faster for tiny collections) with varying impact on larger datasets. For detailed benchmarks across Ruby versions and YJIT configurations, see our [benchmark documentation](docs/benchmarks/README.md).
122
+ Performance has been thoroughly tested across Ruby versions (3.2.8, 3.3.7, and 3.4.2). YJIT provides significant improvements (40-89% faster) with the greatest impact on medium-sized datasets. For detailed benchmarks across Ruby versions and YJIT configurations, see our [benchmark documentation](docs/benchmarks/README.md).
56
123
 
57
124
  ### Recommendations
58
125
 
@@ -71,11 +138,64 @@ Performance has been thoroughly tested across Ruby versions (3.2.8, 3.3.7, and 3
71
138
 
72
139
  ## Development
73
140
 
74
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
141
+ After checking out the repo, run `bin/setup` to install dependencies. Then:
142
+
143
+ 1. Run `rake spec` to run the test suite
144
+ 2. Run `bundle exec ruby examples/quality.rb` to run the quality checks
145
+ 3. Run `rake rubocop` to check code style
146
+ 4. Run `bin/console` for an interactive prompt
147
+
148
+ For more information about the gem, its features, and quality checks, see our [documentation](docs/README.md).
75
149
 
76
150
  ## Contributing
77
151
 
78
- Bug reports and pull requests are welcome on GitHub at https://github.com/llwebconsulting/type_balancer. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/llwebconsulting/type_balancer/blob/main/CODE_OF_CONDUCT.md).
152
+ We welcome contributions to TypeBalancer! Here's how you can help:
153
+
154
+ 1. **Fork the Repository**
155
+ - Visit the [TypeBalancer repository](https://github.com/llwebconsulting/type_balancer)
156
+ - Click the "Fork" button in the top right
157
+ - Clone your fork locally: `git clone git@github.com:your-username/type_balancer.git`
158
+
159
+ 2. **Create a Feature Branch**
160
+ ```bash
161
+ git checkout -b feature/your-feature-name
162
+ ```
163
+
164
+ 3. **Make Your Changes**
165
+ - Write tests for new functionality
166
+ - Ensure all tests pass: `rake spec`
167
+ - Run quality checks: `bundle exec ruby examples/quality.rb`
168
+ - Check code style: `rake rubocop`
169
+ - Update documentation as needed
170
+
171
+ 4. **Commit Your Changes**
172
+ ```bash
173
+ git commit -am 'feat: add some feature'
174
+ ```
175
+ Please follow [conventional commits](https://www.conventionalcommits.org/) for commit messages.
176
+
177
+ 5. **Push to Your Fork**
178
+ ```bash
179
+ git push origin feature/your-feature-name
180
+ ```
181
+
182
+ 6. **Create a Pull Request**
183
+ - Visit your fork on GitHub
184
+ - Click "New Pull Request"
185
+ - Ensure the base branch is `main`
186
+ - Provide a clear description of your changes
187
+ - Link any relevant issues
188
+
189
+ ### Pull Request Requirements
190
+ - All CI checks must pass
191
+ - Test coverage should be maintained or improved
192
+ - Documentation should be updated as needed
193
+ - Code should follow the project's style guide
194
+ - Quality script should pass without new issues
195
+
196
+ For more detailed information about our development process and tools:
197
+ - [Documentation](docs/README.md)
198
+ - [Benchmark Documentation](docs/benchmarks/README.md)
79
199
 
80
200
  ## License
81
201
 
data/Rakefile CHANGED
@@ -66,36 +66,14 @@ task default: [:test_with_mocks, 'lint:all']
66
66
 
67
67
  # Benchmark tasks
68
68
  namespace :benchmark do
69
- desc 'Run distributor benchmark comparing C extension vs Pure Ruby (without YJIT)'
70
- task :distributor do
71
- ruby 'benchmark/distributor_benchmark.rb'
69
+ desc 'Run end-to-end benchmarks'
70
+ task :end_to_end do
71
+ ruby 'benchmark/end_to_end_benchmark.rb'
72
72
  end
73
73
 
74
- desc 'Run combined benchmark comparing full C vs Ruby implementations (without YJIT)'
75
- task :combined do
76
- ruby 'benchmark/combined_benchmark.rb'
77
- end
78
-
79
- desc 'Run all benchmarks (without YJIT)'
80
- task all: %i[distributor combined]
81
-
82
- namespace :yjit do
83
- desc 'Run distributor benchmark comparing C extension vs Pure Ruby with YJIT enabled'
84
- task :distributor do
85
- ENV['RUBY_YJIT_ENABLE'] = '1'
86
- ruby 'benchmark/distributor_benchmark.rb'
87
- end
88
-
89
- desc 'Run combined benchmark comparing full C vs Ruby implementations with YJIT enabled'
90
- task :combined do
91
- ENV['RUBY_YJIT_ENABLE'] = '1'
92
- ruby 'benchmark/combined_benchmark.rb'
93
- end
94
-
95
- desc 'Run all benchmarks with YJIT enabled'
96
- task all: %i[distributor combined]
97
- end
74
+ desc 'Run all benchmarks'
75
+ task all: [:end_to_end]
98
76
 
99
- desc 'Run all benchmarks with and without YJIT'
100
- task complete: %i[all yjit:all]
77
+ desc 'Run complete benchmark suite'
78
+ task complete: [:all]
101
79
  end
@@ -22,7 +22,7 @@ def generate_test_data(size)
22
22
  end
23
23
  end
24
24
 
25
- # More granular test cases
25
+ # Test cases with different dataset sizes
26
26
  TEST_CASES = [
27
27
  { name: "Tiny Dataset", size: 10 },
28
28
  { name: "Small Dataset", size: 100 },
@@ -32,6 +32,7 @@ TEST_CASES = [
32
32
 
33
33
  def run_benchmark
34
34
  puts "\nRunning benchmarks..."
35
+ types = %w[video image article]
35
36
 
36
37
  TEST_CASES.each do |test_case|
37
38
  puts "\nBenchmarking #{test_case[:name]} (#{test_case[:size]} items)"
@@ -54,9 +55,11 @@ def run_benchmark
54
55
 
55
56
  # Print distribution stats for verification
56
57
  result = TypeBalancer.balance(collection, type_field: :type)
58
+ # Flatten batches into a single array
59
+ flattened_result = result.flatten
57
60
  puts "\nDistribution Stats:"
58
- %w[video image article].each do |type|
59
- count = result.count { |i| i[:type] == type }
61
+ types.each do |type|
62
+ count = flattened_result.count { |i| i[:type] == type }
60
63
  puts "#{type.capitalize}: #{count} (#{(count.to_f / test_case[:size] * 100).round(2)}%)"
61
64
  end
62
65
  end
@@ -9,9 +9,9 @@ Running benchmarks...
9
9
  Benchmarking Tiny Dataset (10 items)
10
10
  ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
11
11
  Warming up --------------------------------------
12
- Ruby Implementation 5.815k i/100ms
12
+ Ruby Implementation 12.737k i/100ms
13
13
  Calculating -------------------------------------
14
- Ruby Implementation 70.626k8.1%) i/s (14.16 μs/i) - 145.375k in 2.072857s
14
+ Ruby Implementation 126.497k9.6%) i/s (7.91 μs/i) - 254.740k in 2.033633s
15
15
 
16
16
  Distribution Stats:
17
17
  Video: 4 (40.0%)
@@ -21,9 +21,9 @@ Article: 3 (30.0%)
21
21
  Benchmarking Small Dataset (100 items)
22
22
  ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
23
23
  Warming up --------------------------------------
24
- Ruby Implementation 179.000 i/100ms
24
+ Ruby Implementation 2.261k i/100ms
25
25
  Calculating -------------------------------------
26
- Ruby Implementation 1.904k4.8%) i/s (525.33 μs/i) - 3.938k in 2.073542s
26
+ Ruby Implementation 23.642k9.3%) i/s (42.30 μs/i) - 47.481k in 2.025722s
27
27
 
28
28
  Distribution Stats:
29
29
  Video: 34 (34.0%)
@@ -33,9 +33,9 @@ Article: 33 (33.0%)
33
33
  Benchmarking Medium Dataset (1000 items)
34
34
  ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
35
35
  Warming up --------------------------------------
36
- Ruby Implementation 1.000 i/100ms
36
+ Ruby Implementation 248.000 i/100ms
37
37
  Calculating -------------------------------------
38
- Ruby Implementation 20.785 9.6%) i/s (48.11 ms/i) - 62.000 in 3.018630s
38
+ Ruby Implementation 2.417k19.4%) i/s (413.65 μs/i) - 6.944k in 3.022707s
39
39
 
40
40
  Distribution Stats:
41
41
  Video: 334 (33.4%)
@@ -45,9 +45,9 @@ Article: 333 (33.3%)
45
45
  Benchmarking Large Dataset (10000 items)
46
46
  ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
47
47
  Warming up --------------------------------------
48
- Ruby Implementation 1.000 i/100ms
48
+ Ruby Implementation 28.000 i/100ms
49
49
  Calculating -------------------------------------
50
- Ruby Implementation 0.229 0.0%) i/s (4.37 s/i) - 1.000 in 4.371704s
50
+ Ruby Implementation 267.85512.7%) i/s (3.73 ms/i) - 812.000 in 3.093948s
51
51
 
52
52
  Distribution Stats:
53
53
  Video: 3334 (33.34%)
@@ -2,16 +2,16 @@
2
2
  + bundle exec ruby -I lib benchmark/end_to_end_benchmark.rb
3
3
  Ruby version: 3.2.8
4
4
  RUBY_PLATFORM: aarch64-linux
5
- YJIT enabled: false
5
+ YJIT enabled: true
6
6
 
7
7
  Running benchmarks...
8
8
 
9
9
  Benchmarking Tiny Dataset (10 items)
10
- ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
10
+ ruby 3.2.8 (2025-03-26 revision 13f495dc2c) +YJIT [aarch64-linux]
11
11
  Warming up --------------------------------------
12
- Ruby Implementation 8.136k i/100ms
12
+ Ruby Implementation 14.779k i/100ms
13
13
  Calculating -------------------------------------
14
- Ruby Implementation 74.212k 6.1%) i/s (13.47 μs/i) - 154.584k in 2.090755s
14
+ Ruby Implementation 157.751k10.4%) i/s (6.34 μs/i) - 325.138k in 2.085954s
15
15
 
16
16
  Distribution Stats:
17
17
  Video: 4 (40.0%)
@@ -19,11 +19,11 @@ Image: 3 (30.0%)
19
19
  Article: 3 (30.0%)
20
20
 
21
21
  Benchmarking Small Dataset (100 items)
22
- ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
22
+ ruby 3.2.8 (2025-03-26 revision 13f495dc2c) +YJIT [aarch64-linux]
23
23
  Warming up --------------------------------------
24
- Ruby Implementation 181.000 i/100ms
24
+ Ruby Implementation 2.795k i/100ms
25
25
  Calculating -------------------------------------
26
- Ruby Implementation 1.934k4.9%) i/s (517.12 μs/i) - 3.982k in 2.064193s
26
+ Ruby Implementation 30.774k7.0%) i/s (32.50 μs/i) - 61.490k in 2.007908s
27
27
 
28
28
  Distribution Stats:
29
29
  Video: 34 (34.0%)
@@ -31,11 +31,11 @@ Image: 33 (33.0%)
31
31
  Article: 33 (33.0%)
32
32
 
33
33
  Benchmarking Medium Dataset (1000 items)
34
- ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
34
+ ruby 3.2.8 (2025-03-26 revision 13f495dc2c) +YJIT [aarch64-linux]
35
35
  Warming up --------------------------------------
36
- Ruby Implementation 1.000 i/100ms
36
+ Ruby Implementation 321.000 i/100ms
37
37
  Calculating -------------------------------------
38
- Ruby Implementation 18.61116.1%) i/s (53.73 ms/i) - 54.000 in 3.010201s
38
+ Ruby Implementation 2.931k18.8%) i/s (341.19 μs/i) - 8.667k in 3.086876s
39
39
 
40
40
  Distribution Stats:
41
41
  Video: 334 (33.4%)
@@ -43,11 +43,11 @@ Image: 333 (33.3%)
43
43
  Article: 333 (33.3%)
44
44
 
45
45
  Benchmarking Large Dataset (10000 items)
46
- ruby 3.2.8 (2025-03-26 revision 13f495dc2c) [aarch64-linux]
46
+ ruby 3.2.8 (2025-03-26 revision 13f495dc2c) +YJIT [aarch64-linux]
47
47
  Warming up --------------------------------------
48
- Ruby Implementation 1.000 i/100ms
48
+ Ruby Implementation 35.000 i/100ms
49
49
  Calculating -------------------------------------
50
- Ruby Implementation 0.227 0.0%) i/s (4.41 s/i) - 1.000 in 4.405356s
50
+ Ruby Implementation 356.22312.4%) i/s (2.81 ms/i) - 1.050k in 3.028643s
51
51
 
52
52
  Distribution Stats:
53
53
  Video: 3334 (33.34%)
@@ -9,9 +9,9 @@ Running benchmarks...
9
9
  Benchmarking Tiny Dataset (10 items)
10
10
  ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
11
11
  Warming up --------------------------------------
12
- Ruby Implementation 6.917k i/100ms
12
+ Ruby Implementation 11.284k i/100ms
13
13
  Calculating -------------------------------------
14
- Ruby Implementation 66.848k4.7%) i/s (14.96 μs/i) - 138.340k in 2.074218s
14
+ Ruby Implementation 126.984k6.9%) i/s (7.87 μs/i) - 259.532k in 2.054088s
15
15
 
16
16
  Distribution Stats:
17
17
  Video: 4 (40.0%)
@@ -21,9 +21,9 @@ Article: 3 (30.0%)
21
21
  Benchmarking Small Dataset (100 items)
22
22
  ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
23
23
  Warming up --------------------------------------
24
- Ruby Implementation 174.000 i/100ms
24
+ Ruby Implementation 749.000 i/100ms
25
25
  Calculating -------------------------------------
26
- Ruby Implementation 1.897k 4.5%) i/s (527.03 μs/i) - 3.828k in 2.021687s
26
+ Ruby Implementation 19.547k15.9%) i/s (51.16 μs/i) - 38.199k in 2.007898s
27
27
 
28
28
  Distribution Stats:
29
29
  Video: 34 (34.0%)
@@ -33,9 +33,9 @@ Article: 33 (33.0%)
33
33
  Benchmarking Medium Dataset (1000 items)
34
34
  ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
35
35
  Warming up --------------------------------------
36
- Ruby Implementation 2.000 i/100ms
36
+ Ruby Implementation 205.000 i/100ms
37
37
  Calculating -------------------------------------
38
- Ruby Implementation 19.51110.3%) i/s (51.25 ms/i) - 58.000 in 3.018480s
38
+ Ruby Implementation 2.299k 9.3%) i/s (434.98 μs/i) - 6.970k in 3.064546s
39
39
 
40
40
  Distribution Stats:
41
41
  Video: 334 (33.4%)
@@ -45,9 +45,9 @@ Article: 333 (33.3%)
45
45
  Benchmarking Large Dataset (10000 items)
46
46
  ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
47
47
  Warming up --------------------------------------
48
- Ruby Implementation 1.000 i/100ms
48
+ Ruby Implementation 27.000 i/100ms
49
49
  Calculating -------------------------------------
50
- Ruby Implementation 0.2240.0%) i/s (4.46 s/i) - 1.000 in 4.464788s
50
+ Ruby Implementation 271.4254.8%) i/s (3.68 ms/i) - 837.000 in 3.091882s
51
51
 
52
52
  Distribution Stats:
53
53
  Video: 3334 (33.34%)
@@ -2,16 +2,16 @@
2
2
  + bundle exec ruby -I lib benchmark/end_to_end_benchmark.rb
3
3
  Ruby version: 3.3.7
4
4
  RUBY_PLATFORM: aarch64-linux
5
- YJIT enabled: false
5
+ YJIT enabled: true
6
6
 
7
7
  Running benchmarks...
8
8
 
9
9
  Benchmarking Tiny Dataset (10 items)
10
- ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
10
+ ruby 3.3.7 (2025-01-15 revision be31f993d7) +YJIT [aarch64-linux]
11
11
  Warming up --------------------------------------
12
- Ruby Implementation 6.343k i/100ms
12
+ Ruby Implementation 15.811k i/100ms
13
13
  Calculating -------------------------------------
14
- Ruby Implementation 66.941k 6.0%) i/s (14.94 μs/i) - 139.546k in 2.092006s
14
+ Ruby Implementation 176.585k10.2%) i/s (5.66 μs/i) - 363.653k in 2.084636s
15
15
 
16
16
  Distribution Stats:
17
17
  Video: 4 (40.0%)
@@ -19,11 +19,11 @@ Image: 3 (30.0%)
19
19
  Article: 3 (30.0%)
20
20
 
21
21
  Benchmarking Small Dataset (100 items)
22
- ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
22
+ ruby 3.3.7 (2025-01-15 revision be31f993d7) +YJIT [aarch64-linux]
23
23
  Warming up --------------------------------------
24
- Ruby Implementation 175.000 i/100ms
24
+ Ruby Implementation 2.755k i/100ms
25
25
  Calculating -------------------------------------
26
- Ruby Implementation 1.888k5.1%) i/s (529.71 μs/i) - 3.850k in 2.044860s
26
+ Ruby Implementation 29.060k8.7%) i/s (34.41 μs/i) - 57.855k in 2.007501s
27
27
 
28
28
  Distribution Stats:
29
29
  Video: 34 (34.0%)
@@ -31,11 +31,11 @@ Image: 33 (33.0%)
31
31
  Article: 33 (33.0%)
32
32
 
33
33
  Benchmarking Medium Dataset (1000 items)
34
- ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
34
+ ruby 3.3.7 (2025-01-15 revision be31f993d7) +YJIT [aarch64-linux]
35
35
  Warming up --------------------------------------
36
- Ruby Implementation 1.000 i/100ms
36
+ Ruby Implementation 328.000 i/100ms
37
37
  Calculating -------------------------------------
38
- Ruby Implementation 19.92315.1%) i/s (50.19 ms/i) - 59.000 in 3.031767s
38
+ Ruby Implementation 3.619k10.0%) i/s (276.35 μs/i) - 10.824k in 3.027879s
39
39
 
40
40
  Distribution Stats:
41
41
  Video: 334 (33.4%)
@@ -43,11 +43,11 @@ Image: 333 (33.3%)
43
43
  Article: 333 (33.3%)
44
44
 
45
45
  Benchmarking Large Dataset (10000 items)
46
- ruby 3.3.7 (2025-01-15 revision be31f993d7) [aarch64-linux]
46
+ ruby 3.3.7 (2025-01-15 revision be31f993d7) +YJIT [aarch64-linux]
47
47
  Warming up --------------------------------------
48
- Ruby Implementation 1.000 i/100ms
48
+ Ruby Implementation 40.000 i/100ms
49
49
  Calculating -------------------------------------
50
- Ruby Implementation 0.2240.0%) i/s (4.47 s/i) - 1.000 in 4.467441s
50
+ Ruby Implementation 394.0974.8%) i/s (2.54 ms/i) - 1.200k in 3.053424s
51
51
 
52
52
  Distribution Stats:
53
53
  Video: 3334 (33.34%)
@@ -9,9 +9,9 @@ Running benchmarks...
9
9
  Benchmarking Tiny Dataset (10 items)
10
10
  ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [aarch64-linux]
11
11
  Warming up --------------------------------------
12
- Ruby Implementation 6.476k i/100ms
12
+ Ruby Implementation 11.805k i/100ms
13
13
  Calculating -------------------------------------
14
- Ruby Implementation 66.552k 5.7%) i/s (15.03 μs/i) - 135.996k in 2.050038s
14
+ Ruby Implementation 108.979k11.4%) i/s (9.18 μs/i) - 224.295k in 2.082118s
15
15
 
16
16
  Distribution Stats:
17
17
  Video: 4 (40.0%)
@@ -21,9 +21,9 @@ Article: 3 (30.0%)
21
21
  Benchmarking Small Dataset (100 items)
22
22
  ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [aarch64-linux]
23
23
  Warming up --------------------------------------
24
- Ruby Implementation 168.000 i/100ms
24
+ Ruby Implementation 1.992k i/100ms
25
25
  Calculating -------------------------------------
26
- Ruby Implementation 1.790k5.2%) i/s (558.74 μs/i) - 3.696k in 2.070989s
26
+ Ruby Implementation 21.879k6.7%) i/s (45.71 μs/i) - 43.824k in 2.011722s
27
27
 
28
28
  Distribution Stats:
29
29
  Video: 34 (34.0%)
@@ -33,9 +33,9 @@ Article: 33 (33.0%)
33
33
  Benchmarking Medium Dataset (1000 items)
34
34
  ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [aarch64-linux]
35
35
  Warming up --------------------------------------
36
- Ruby Implementation 1.000 i/100ms
36
+ Ruby Implementation 248.000 i/100ms
37
37
  Calculating -------------------------------------
38
- Ruby Implementation 19.04310.5%) i/s (52.51 ms/i) - 57.000 in 3.042588s
38
+ Ruby Implementation 2.004k25.1%) i/s (498.96 μs/i) - 5.704k in 3.120598s
39
39
 
40
40
  Distribution Stats:
41
41
  Video: 334 (33.4%)
@@ -45,9 +45,9 @@ Article: 333 (33.3%)
45
45
  Benchmarking Large Dataset (10000 items)
46
46
  ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [aarch64-linux]
47
47
  Warming up --------------------------------------
48
- Ruby Implementation 1.000 i/100ms
48
+ Ruby Implementation 17.000 i/100ms
49
49
  Calculating -------------------------------------
50
- Ruby Implementation 0.212 0.0%) i/s (4.71 s/i) - 1.000 in 4.711867s
50
+ Ruby Implementation 264.18310.6%) i/s (3.79 ms/i) - 782.000 in 3.006879s
51
51
 
52
52
  Distribution Stats:
53
53
  Video: 3334 (33.34%)