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 +4 -4
- data/.DS_Store +0 -0
- data/CHANGELOG.md +37 -3
- data/Dockerfile +3 -1
- data/Gemfile.lock +1 -1
- data/README.md +129 -9
- data/Rakefile +7 -29
- data/benchmark/end_to_end_benchmark.rb +6 -3
- data/benchmark_results/ruby3.2.8.txt +8 -8
- data/benchmark_results/ruby3.2.8_yjit.txt +13 -13
- data/benchmark_results/ruby3.3.7.txt +8 -8
- data/benchmark_results/ruby3.3.7_yjit.txt +13 -13
- data/benchmark_results/ruby3.4.2.txt +8 -8
- data/benchmark_results/ruby3.4.2_yjit.txt +13 -13
- data/docs/README.md +8 -0
- data/docs/balance.md +71 -0
- data/docs/benchmarks/README.md +57 -51
- data/docs/calculate_positions.md +87 -0
- data/docs/quality.md +101 -0
- data/examples/balance_test_data.yml +66 -0
- data/examples/quality.rb +230 -46
- data/lib/type_balancer/balancer.rb +71 -94
- data/lib/type_balancer/batch_processing.rb +35 -0
- data/lib/type_balancer/distributor.rb +26 -53
- data/lib/type_balancer/position_calculator.rb +61 -0
- data/lib/type_balancer/ratio_calculator.rb +91 -0
- data/lib/type_balancer/type_extractor.rb +29 -0
- data/lib/type_balancer/version.rb +1 -1
- data/lib/type_balancer.rb +36 -17
- metadata +12 -3
- data/sig/type_balancer.rbs +0 -85
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f73ec86fddfda3cd22f19b0081824a8a488e1a47359976e32eb6b999074b92a3
|
4
|
+
data.tar.gz: f25f85b6caeeeb3a5f8012ae295b96ae02413e4b4342aba946438bbcbb9eb063
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8895eea255feccab33cd33ba70d9bfb486a4ff9108ba1a828d1be72b501db1635cb35d5aab574298923533d1080c29d7b45a50bb8d1547ffdacfd882dc4d491
|
7
|
+
data.tar.gz: '09f755338981a1523cae4eddc3468b17d7693b9183e7039b7e81f1d24bd6beab29133d9d9a797487ea3745195f3f4e577311c89258b41fa237bd63cc3fb63cd2'
|
data/.DS_Store
ADDED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,39 @@
|
|
1
|
-
|
1
|
+
# Changelog
|
2
2
|
|
3
|
-
## [0.1.
|
3
|
+
## [0.1.2] - 2024-04-11
|
4
4
|
|
5
|
-
-
|
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
data/README.md
CHANGED
@@ -2,12 +2,25 @@
|
|
2
2
|
|
3
3
|
# TypeBalancer
|
4
4
|
|
5
|
-
[](https://
|
5
|
+
[](https://rubygems.org/gems/type_balancer)
|
6
6
|
[](https://github.com/llwebconsulting/type_balancer/actions/workflows/ci.yml)
|
7
7
|
[](https://github.com/llwebconsulting/type_balancer/blob/main/coverage/index.html)
|
8
8
|
[](LICENSE.txt)
|
9
9
|
|
10
|
-
|
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 (
|
51
|
-
- Small collections (100 items): Sub-millisecond processing (
|
52
|
-
- Medium collections (1,000 items): Fast processing (
|
53
|
-
- Large collections (10,000 items): Efficient processing (
|
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
|
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
|
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
|
-
|
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
|
70
|
-
task :
|
71
|
-
ruby 'benchmark/
|
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
|
75
|
-
task :
|
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
|
100
|
-
task complete:
|
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
|
-
#
|
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
|
-
|
59
|
-
count =
|
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
|
12
|
+
Ruby Implementation 12.737k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 126.497k (± 9.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
|
24
|
+
Ruby Implementation 2.261k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 23.642k (± 9.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
|
36
|
+
Ruby Implementation 248.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 2.417k (±19.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
|
48
|
+
Ruby Implementation 28.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 267.855 (±12.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:
|
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
|
12
|
+
Ruby Implementation 14.779k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 157.751k (±10.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
|
24
|
+
Ruby Implementation 2.795k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 30.774k (± 7.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
|
36
|
+
Ruby Implementation 321.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 2.931k (±18.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
|
48
|
+
Ruby Implementation 35.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 356.223 (±12.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
|
12
|
+
Ruby Implementation 11.284k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 126.984k (± 6.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
|
24
|
+
Ruby Implementation 749.000 i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 19.547k (±15.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
|
36
|
+
Ruby Implementation 205.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
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
|
48
|
+
Ruby Implementation 27.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 271.425 (± 4.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:
|
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
|
12
|
+
Ruby Implementation 15.811k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 176.585k (±10.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
|
24
|
+
Ruby Implementation 2.755k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 29.060k (± 8.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
|
36
|
+
Ruby Implementation 328.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 3.619k (±10.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
|
48
|
+
Ruby Implementation 40.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 394.097 (± 4.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
|
12
|
+
Ruby Implementation 11.805k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 108.979k (±11.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
|
24
|
+
Ruby Implementation 1.992k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 21.879k (± 6.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
|
36
|
+
Ruby Implementation 248.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 2.004k (±25.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
|
48
|
+
Ruby Implementation 17.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 264.183 (±10.6%) i/s (3.79 ms/i) - 782.000 in 3.006879s
|
51
51
|
|
52
52
|
Distribution Stats:
|
53
53
|
Video: 3334 (33.34%)
|