purplelight 0.1.18 → 0.1.19
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/PERFORMANCE_NOTES.md +4 -2
- data/README.md +3 -2
- data/benchmark/baseline.json +405 -391
- data/benchmark/microbench.rb +1 -0
- data/lib/purplelight/queue.rb +6 -1
- data/lib/purplelight/snapshot.rb +25 -4
- data/lib/purplelight/version.rb +1 -1
- data/lib/purplelight/writer_parquet.rb +4 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 300107b11002d6ede77f9ce6adc7c8f8d30045a34a43952c2b9d0c0d60e784a1
|
|
4
|
+
data.tar.gz: 20093fbe1faca5ea331258cf410fb57e71bdf8055388b2304672f2aedb2c7943
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0c9f55c415a779b42a7f95c1a6468d68538670235f5cc475dc6ef110145b50566b826a1dfec8f7f048539ed8949c7061fd120df85f59126aa1bfe11c1157e8f0
|
|
7
|
+
data.tar.gz: fc7486b767c89ff9a308a2bd88ddb580400a0e7e830f457065f7e1bc19db44ab688ce82b27d0bfe95b15d964cd211aab5399663c30b519151a55ceab9626fe58
|
data/PERFORMANCE_NOTES.md
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# Purplelight upgrade and performance notes
|
|
2
2
|
|
|
3
|
-
Updated: 2026-07-
|
|
3
|
+
Updated: 2026-07-23
|
|
4
4
|
|
|
5
5
|
## Completed
|
|
6
6
|
|
|
7
7
|
- Pinned managed development Ruby 4.0.2; no Homebrew Ruby is used.
|
|
8
8
|
- Updated all Ruby 3.2-compatible dependencies: MongoDB Ruby driver 2.24.1, BSON 5.2.0, zstd-ruby 2.0.6, red-arrow/red-parquet 25.0.0, Rake 13.4.2, RSpec 3.13.2, RuboCop 1.88.2, SimpleCov 1.0.2, StackProf 0.2.28, and current transitives. `parallel` remains on 1.28 because 2.x requires Ruby 3.3; `diff-lcs` 2.0 remains blocked by RSpec's `< 2.0` constraint.
|
|
9
9
|
- Updated CI to MongoDB 7 and 8, Ruby 3.2 and 4.0, Apache Arrow 25, and `actions/checkout@v7.0.1`.
|
|
10
|
-
- Added
|
|
10
|
+
- Added 55 bounded microbenchmarks covering all eight runtime paths, including 28 Parquet column types plus full-table, row-group, and projection reads. The harness enforces 100% path registration, takes the median of five samples, measures allocations, and aborts each timed sample or allocation pass after two seconds. The slowest observed timed sample in the expanded suite was 0.397 seconds.
|
|
11
11
|
- Added CPU and object-allocation StackProf tasks plus generated flamegraph support.
|
|
12
12
|
- Added SimpleCov line and branch enforcement. The full suite verifies 100% line and branch coverage, including CLI and MongoDB integration behavior.
|
|
13
13
|
- Added focused behavioral coverage for queue backpressure, manifests, telemetry, partition planning, compression backends, rotations, Parquet row groups, resumability, concurrent JSONL writing, progress, and telemetry output.
|
|
14
14
|
- Made persistent MongoDB fixtures rerunnable by dropping static test collections before seeding.
|
|
15
15
|
- Persisted the exact Extended JSON partition plan in manifest version 2. Resume now reuses the original boundaries rather than replanning against a growing collection, preventing boundary replay and duplicate rows.
|
|
16
|
+
- BSON Symbol values now use Purplelight's direct UTF-8 Arrow string builder for scalar columns and recursive list leaves. Cached row-group schemas therefore remain buildable instead of failing through red-arrow's unsupported `DictionaryDataType#build_array` path.
|
|
17
|
+
- Snapshot reader and writer failures now atomically close and discard the shared byte queue, immediately waking blocked producers and preserving the first worker exception for the caller.
|
|
16
18
|
|
|
17
19
|
## Retained performance changes
|
|
18
20
|
|
data/README.md
CHANGED
|
@@ -11,13 +11,13 @@ Requires Ruby 3.2 or newer and MongoDB 7 or 8.
|
|
|
11
11
|
Add to your Gemfile:
|
|
12
12
|
|
|
13
13
|
```ruby
|
|
14
|
-
gem 'purplelight', '~> 0.1.
|
|
14
|
+
gem 'purplelight', '~> 0.1.19'
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Or install directly:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
gem install purplelight -v '~> 0.1.
|
|
20
|
+
gem install purplelight -v '~> 0.1.19'
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
`bigdecimal`, `logger`, and the MongoDB Ruby driver are installed automatically.
|
|
@@ -178,6 +178,7 @@ Notes for Parquet:
|
|
|
178
178
|
- `--rotate-mb` / `part_bytes` do not affect Parquet part size; they apply to JSONL/CSV.
|
|
179
179
|
- Use `sharding: { mode: :single_file }` to force a single `.parquet` file.
|
|
180
180
|
- The first row group defines the Arrow schema. Later values must remain type-compatible; integer values outside the inferred width raise `RangeError` instead of wrapping.
|
|
181
|
+
- BSON Symbol values, which the MongoDB driver exposes as Ruby `Symbol` objects, are exported as UTF-8 strings. This applies to scalar values and list elements across every row group.
|
|
181
182
|
- Dictionary encoding is chosen from the first row group for read performance: list leaves retain it, while scalar strings use it only when they have at most 16 distinct values and average at least four repetitions per value.
|
|
182
183
|
- Dictionary selection changes physical Parquet page encodings and file checksums only; logical schemas, values, nullability, ordering, and row-group boundaries remain compatible. Consumers should validate logical data rather than requiring a particular page encoding.
|
|
183
184
|
- In the matched 50,000-row, 27-column benchmark, this policy improved full-table reads by 15.9%, row-group streaming by 29.1%, projected reads by 30.9%, and reduced file size by 31.5%. Existing snapshots must be re-exported to receive these gains; see `PERFORMANCE_NOTES.md` for the complete matrix.
|