type_balancer 0.1.4 → 0.2.1
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/.rubocop.yml +3 -0
- data/CHANGELOG.md +51 -0
- data/Gemfile.lock +1 -1
- data/README.md +65 -4
- data/Rakefile +19 -1
- data/benchmark_results/ruby3.2.8.txt +8 -8
- data/benchmark_results/ruby3.2.8_yjit.txt +8 -8
- data/benchmark_results/ruby3.3.7.txt +8 -8
- data/benchmark_results/ruby3.3.7_yjit.txt +8 -8
- data/benchmark_results/ruby3.4.2.txt +8 -8
- data/benchmark_results/ruby3.4.2_yjit.txt +8 -8
- data/docs/balance.md +113 -10
- data/docs/quality.md +10 -2
- data/examples/large_scale_balance_test.rb +168 -0
- data/examples/quality.rb +80 -7
- data/lib/type_balancer/calculator.rb +37 -90
- data/lib/type_balancer/configuration.rb +31 -0
- data/lib/type_balancer/distributor.rb +70 -17
- data/lib/type_balancer/strategies/base_strategy.rb +58 -0
- data/lib/type_balancer/strategies/sliding_window_strategy.rb +199 -0
- data/lib/type_balancer/strategies.rb +7 -0
- data/lib/type_balancer/strategy_factory.rb +41 -0
- data/lib/type_balancer/version.rb +1 -1
- data/lib/type_balancer.rb +35 -10
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa2741d3d75b46e223d47fa50688978cbcf3a8c6faf2866ccf97144a8459b64d
|
4
|
+
data.tar.gz: 927c67db18171fe13d151f4d720b163fa4494c24e9f0fb48508cc4cf91ff1444
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6afefaf19925b4281778baa1a8c8da2bec31301ea15d0d73056a182affc89f50103948af59a1e1ec82fd6355354882d1cbfcaadd27499737c68812c31da903bf
|
7
|
+
data.tar.gz: 73b8f72dbfef3c30618c65508355937c24ffde11e699eb069b470c68d83450b66806979ceb49e864a3e812fdbf3b7b6a8bf4b5557f3f3d40fdb48533ccd9268e
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,56 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## [0.2.1] - 2025-05-01
|
4
|
+
|
5
|
+
### Performance
|
6
|
+
- Major performance improvements in the sliding window strategy implementation:
|
7
|
+
- Optimized window position calculation algorithm
|
8
|
+
- Improved batch processing for large collections
|
9
|
+
- Enhanced type distribution handling
|
10
|
+
- Reduced memory usage and allocation
|
11
|
+
- Updated benchmark results showing consistent performance:
|
12
|
+
- Tiny collections (10 items): 8-13μs
|
13
|
+
- Small collections (100 items): 68-104μs
|
14
|
+
- Medium collections (1,000 items): 648ms-1.03ms
|
15
|
+
- Large collections (10,000 items): 6.6-10.0ms
|
16
|
+
|
17
|
+
### Enhanced
|
18
|
+
- Improved test suite with more focused test cases
|
19
|
+
- Reduced test execution time by optimizing large-scale test data
|
20
|
+
- Better handling of type ordering in Calculator and BaseStrategy
|
21
|
+
- Enhanced quality.rb output formatting for better readability
|
22
|
+
- Simplified large_scale_balance_test.rb implementation
|
23
|
+
|
24
|
+
### Fixed
|
25
|
+
- Rubocop violations:
|
26
|
+
- Disabled Style/HashExcept cop
|
27
|
+
- Added parameter list exceptions for complex method signatures
|
28
|
+
- Improved require statements in example scripts to use require_relative
|
29
|
+
|
30
|
+
## [0.2.0] - 2025-04-30
|
31
|
+
|
32
|
+
### Added
|
33
|
+
- Introduced strategy pattern for flexible balancing algorithms
|
34
|
+
- Added sliding window strategy as the default balancing algorithm
|
35
|
+
- Configurable window size (default: 10)
|
36
|
+
- Maintains both local and global type ratios
|
37
|
+
- Adaptive behavior for remaining items
|
38
|
+
- Added comprehensive strategy documentation in README and balance.md
|
39
|
+
- Added large scale balance test suite for thorough strategy validation
|
40
|
+
|
41
|
+
### Enhanced
|
42
|
+
- Improved quality testing infrastructure
|
43
|
+
- Added quality:all rake task that runs both quality.rb and large_scale_balance_test.rb
|
44
|
+
- Enhanced CI workflow to run all quality checks
|
45
|
+
- Added strategy-specific test cases
|
46
|
+
- Updated documentation with detailed strategy explanations and use cases
|
47
|
+
- Added extensive test coverage for strategy system
|
48
|
+
|
49
|
+
### Fixed
|
50
|
+
- Improved handling of type distribution in edge cases
|
51
|
+
- Better handling of remaining items when types are depleted
|
52
|
+
- Enhanced transition handling between windows
|
53
|
+
|
3
54
|
## [0.1.4] - 2025-04-29
|
4
55
|
|
5
56
|
### Fixed
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -52,15 +52,69 @@ items = [
|
|
52
52
|
# ... more items
|
53
53
|
]
|
54
54
|
|
55
|
-
# Balance items by type
|
55
|
+
# Balance items by type (uses default sliding window strategy)
|
56
56
|
balanced_items = TypeBalancer.balance(items, type_field: :type)
|
57
|
+
|
58
|
+
# Use sliding window strategy with custom window size
|
59
|
+
balanced_items = TypeBalancer.balance(items,
|
60
|
+
type_field: :type,
|
61
|
+
strategy: :sliding_window,
|
62
|
+
window_size: 25
|
63
|
+
)
|
57
64
|
```
|
58
65
|
|
59
66
|
## Balancing Collections with `TypeBalancer.balance`
|
60
67
|
|
61
68
|
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
69
|
|
63
|
-
|
70
|
+
### Available Strategies
|
71
|
+
|
72
|
+
TypeBalancer uses a strategy pattern to provide different balancing algorithms. Currently, the gem implements a sophisticated sliding window strategy as its default approach:
|
73
|
+
|
74
|
+
#### Sliding Window Strategy (Default)
|
75
|
+
The sliding window strategy balances items by examining a fixed-size window of items at a time (default size: 10). Within each window, it maintains the overall ratio of types while ensuring each type gets fair representation. This creates both local and global balance in your content distribution.
|
76
|
+
|
77
|
+
**When to Use Sliding Window Strategy:**
|
78
|
+
- Content feeds where users might stop scrolling at any point
|
79
|
+
- When you want to ensure diversity in any segment of your list
|
80
|
+
- When you need to maintain both local and global balance
|
81
|
+
- When you want to prevent long runs of the same type while still allowing some natural clustering
|
82
|
+
|
83
|
+
**Window Size Selection Guide:**
|
84
|
+
- Small windows (5-10): Strict local balance, ideal for shorter lists or when immediate diversity is critical
|
85
|
+
- Medium windows (15-25): Balance between local and global distribution
|
86
|
+
- Large windows (30+): More gradual transitions, better for preserving some natural clustering
|
87
|
+
|
88
|
+
```ruby
|
89
|
+
# Basic usage with default window size (10)
|
90
|
+
balanced = TypeBalancer.balance(items, type_field: :type)
|
91
|
+
|
92
|
+
# Custom window size for stricter local balance
|
93
|
+
balanced = TypeBalancer.balance(items,
|
94
|
+
type_field: :type,
|
95
|
+
strategy: :sliding_window,
|
96
|
+
window_size: 5
|
97
|
+
)
|
98
|
+
|
99
|
+
# Larger window for more gradual transitions
|
100
|
+
balanced = TypeBalancer.balance(items,
|
101
|
+
type_field: :type,
|
102
|
+
strategy: :sliding_window,
|
103
|
+
window_size: 25
|
104
|
+
)
|
105
|
+
|
106
|
+
# With custom type ordering
|
107
|
+
balanced = TypeBalancer.balance(items,
|
108
|
+
type_field: :type,
|
109
|
+
strategy: :sliding_window,
|
110
|
+
window_size: 15,
|
111
|
+
type_order: %w[image video article]
|
112
|
+
)
|
113
|
+
```
|
114
|
+
|
115
|
+
The strategy system is designed to be extensible, allowing for future implementations of different balancing algorithms as needed.
|
116
|
+
|
117
|
+
### Basic Example
|
64
118
|
|
65
119
|
```ruby
|
66
120
|
items = [
|
@@ -73,18 +127,25 @@ balanced = TypeBalancer.balance(items, type_field: :type)
|
|
73
127
|
# => [ { type: 'article', ... }, { type: 'image', ... }, { type: 'video', ... }, ... ]
|
74
128
|
```
|
75
129
|
|
76
|
-
|
130
|
+
### Custom Type Order
|
77
131
|
|
78
132
|
You can specify a custom order for types using the `type_order` argument. This controls the priority of types in the balanced output.
|
79
133
|
|
80
134
|
```ruby
|
81
135
|
# Prioritize images, then videos, then articles
|
82
|
-
balanced = TypeBalancer.balance(items,
|
136
|
+
balanced = TypeBalancer.balance(items,
|
137
|
+
type_field: :type,
|
138
|
+
type_order: %w[image video article],
|
139
|
+
strategy: :sliding_window,
|
140
|
+
window_size: 15
|
141
|
+
)
|
83
142
|
# => [ { type: 'image', ... }, { type: 'video', ... }, { type: 'article', ... }, ... ]
|
84
143
|
```
|
85
144
|
|
86
145
|
- `type_field`: The key to use for type extraction (default: `:type`).
|
87
146
|
- `type_order`: An array of type names (as strings) specifying the desired order.
|
147
|
+
- `strategy`: The balancing strategy to use (default: `:sliding_window`).
|
148
|
+
- `window_size`: Size of the sliding window for the sliding window strategy (default: 10).
|
88
149
|
|
89
150
|
For more advanced usage and options, see [Detailed Balance Method Documentation](docs/balance.md).
|
90
151
|
|
data/Rakefile
CHANGED
@@ -17,6 +17,24 @@ Rake::ExtensionTask.new('type_balancer') do |ext|
|
|
17
17
|
ext.config_options = ['--with-cflags=-Wall -Wextra -O3']
|
18
18
|
end
|
19
19
|
|
20
|
+
# Quality check tasks
|
21
|
+
namespace :quality do
|
22
|
+
desc 'Run basic quality checks'
|
23
|
+
task :basic do
|
24
|
+
puts "\nRunning basic quality checks..."
|
25
|
+
ruby '-I lib examples/quality.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
desc 'Run large scale balance tests'
|
29
|
+
task :large_scale do
|
30
|
+
puts "\nRunning large scale balance tests..."
|
31
|
+
ruby '-I lib examples/large_scale_balance_test.rb'
|
32
|
+
end
|
33
|
+
|
34
|
+
desc 'Run all quality checks'
|
35
|
+
task all: %i[basic large_scale]
|
36
|
+
end
|
37
|
+
|
20
38
|
# Add GoogleTest task using CMake
|
21
39
|
namespace :gtest do
|
22
40
|
desc 'Build and run all GoogleTest tests'
|
@@ -62,7 +80,7 @@ task test_with_mocks: [:spec] do
|
|
62
80
|
Rake::Task['gtest:all'].invoke
|
63
81
|
end
|
64
82
|
|
65
|
-
task default: [:test_with_mocks, 'lint:all']
|
83
|
+
task default: [:test_with_mocks, 'lint:all', 'quality:all']
|
66
84
|
|
67
85
|
# Benchmark tasks
|
68
86
|
namespace :benchmark do
|
@@ -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 7.321k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 74.105k (± 4.7%) i/s (13.49 μs/i) - 153.741k in 2.079077s
|
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 996.000 i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 10.032k (± 0.8%) i/s (99.68 μs/i) - 20.916k in 2.085103s
|
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 104.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 1.040k (± 1.4%) i/s (961.95 μs/i) - 3.120k in 3.001891s
|
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 10.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 104.445 (± 1.0%) i/s (9.57 ms/i) - 320.000 in 3.063901s
|
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.2.8 (2025-03-26 revision 13f495dc2c) +YJIT [aarch64-linux]
|
11
11
|
Warming up --------------------------------------
|
12
|
-
Ruby Implementation
|
12
|
+
Ruby Implementation 10.640k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 111.468k (± 0.9%) i/s (8.97 μs/i) - 223.440k in 2.004679s
|
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) +YJIT [aarch64-linux]
|
23
23
|
Warming up --------------------------------------
|
24
|
-
Ruby Implementation
|
24
|
+
Ruby Implementation 1.392k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 13.988k (± 0.6%) i/s (71.49 μs/i) - 29.232k in 2.089823s
|
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) +YJIT [aarch64-linux]
|
35
35
|
Warming up --------------------------------------
|
36
|
-
Ruby Implementation
|
36
|
+
Ruby Implementation 145.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 1.436k (± 1.0%) i/s (696.60 μs/i) - 4.350k in 3.030548s
|
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) +YJIT [aarch64-linux]
|
47
47
|
Warming up --------------------------------------
|
48
|
-
Ruby Implementation
|
48
|
+
Ruby Implementation 14.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 142.517 (± 0.7%) i/s (7.02 ms/i) - 434.000 in 3.045580s
|
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 7.474k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 77.780k (± 1.0%) i/s (12.86 μs/i) - 156.954k in 2.018142s
|
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 968.000 i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 9.726k (± 1.3%) i/s (102.81 μs/i) - 20.328k in 2.090308s
|
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 101.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 970.619 (± 8.6%) i/s (1.03 ms/i) - 2.929k in 3.044643s
|
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 9.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 99.743 (± 1.0%) i/s (10.03 ms/i) - 306.000 in 3.068124s
|
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) +YJIT [aarch64-linux]
|
11
11
|
Warming up --------------------------------------
|
12
|
-
Ruby Implementation
|
12
|
+
Ruby Implementation 11.095k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 118.143k (± 1.0%) i/s (8.46 μs/i) - 244.090k in 2.066282s
|
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) +YJIT [aarch64-linux]
|
23
23
|
Warming up --------------------------------------
|
24
|
-
Ruby Implementation
|
24
|
+
Ruby Implementation 1.488k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 14.650k (± 2.2%) i/s (68.26 μs/i) - 29.760k in 2.032402s
|
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) +YJIT [aarch64-linux]
|
35
35
|
Warming up --------------------------------------
|
36
|
-
Ruby Implementation
|
36
|
+
Ruby Implementation 152.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 1.542k (± 1.0%) i/s (648.70 μs/i) - 4.712k in 3.057044s
|
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) +YJIT [aarch64-linux]
|
47
47
|
Warming up --------------------------------------
|
48
|
-
Ruby Implementation
|
48
|
+
Ruby Implementation 14.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 150.143 (± 0.7%) i/s (6.66 ms/i) - 462.000 in 3.077274s
|
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 6.495k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 75.827k (± 1.0%) i/s (13.19 μs/i) - 155.880k in 2.055940s
|
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 960.000 i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 9.600k (± 0.9%) i/s (104.17 μs/i) - 19.200k in 2.000241s
|
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 100.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 991.713 (± 2.2%) i/s (1.01 ms/i) - 3.000k in 3.026621s
|
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 10.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 100.530 (± 1.0%) i/s (9.95 ms/i) - 310.000 in 3.083817s
|
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) +YJIT +PRISM [aarch64-linux]
|
11
11
|
Warming up --------------------------------------
|
12
|
-
Ruby Implementation
|
12
|
+
Ruby Implementation 8.785k i/100ms
|
13
13
|
Calculating -------------------------------------
|
14
|
-
Ruby Implementation
|
14
|
+
Ruby Implementation 112.980k (± 7.7%) i/s (8.85 μs/i) - 228.410k in 2.039442s
|
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) +YJIT +PRISM [aarch64-linux]
|
23
23
|
Warming up --------------------------------------
|
24
|
-
Ruby Implementation
|
24
|
+
Ruby Implementation 1.477k i/100ms
|
25
25
|
Calculating -------------------------------------
|
26
|
-
Ruby Implementation
|
26
|
+
Ruby Implementation 14.639k (± 1.2%) i/s (68.31 μs/i) - 29.540k in 2.018232s
|
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) +YJIT +PRISM [aarch64-linux]
|
35
35
|
Warming up --------------------------------------
|
36
|
-
Ruby Implementation
|
36
|
+
Ruby Implementation 152.000 i/100ms
|
37
37
|
Calculating -------------------------------------
|
38
|
-
Ruby Implementation
|
38
|
+
Ruby Implementation 1.500k (± 3.4%) i/s (666.84 μs/i) - 4.560k in 3.044713s
|
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) +YJIT +PRISM [aarch64-linux]
|
47
47
|
Warming up --------------------------------------
|
48
|
-
Ruby Implementation
|
48
|
+
Ruby Implementation 15.000 i/100ms
|
49
49
|
Calculating -------------------------------------
|
50
|
-
Ruby Implementation
|
50
|
+
Ruby Implementation 151.656 (± 3.3%) i/s (6.59 ms/i) - 465.000 in 3.070430s
|
51
51
|
|
52
52
|
Distribution Stats:
|
53
53
|
Video: 3334 (33.34%)
|