Repository navigation
Optimize attribute parsing and bound Arrow assembly memory (3.0.2) - #94
Merged
Merged
Conversation
Coverage Report for CI Build 37506258083Coverage increased (+1.6%) to 97.236%Details
Uncovered ChangesNo uncovered changes found. Coverage Regressions4 previously-covered lines in 1 file lost coverage.
Coverage Stats
💛 - Coveralls |
iskandr
force-pushed
the
perf/attribute-expansion
branch
from
October 6, 2026 17:40
bd0cd44 to
22ca2df
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
gtfparse 3.0.0 repeatedly splits and trims millions of attribute pairs and retains full-file Python values while assembling compact Arrow string columns. Version 3.0.2 captures ordinary double-quoted pairs directly, removes redundant lookups and conversions, and assembles configured Arrow strings in 250,000-row batches. Temporary Python values are released after each batch and column conversion.
Preserves arbitrary attributes, malformed/custom-quoted and pre-split input, repeated/empty values, missing sentinels, first-seen column order, fixed-field collisions, progress/cancellation, aliases/casts/converters, raw/selective reads, configured Python/object strings, dict/optional Polars output and existing stream/validation behavior. Global pandas options stay under caller control. Polars remains optional.
Fixes #91.
Version allocation: the measured candidate was labeled 3.0.1. This optimization shipped independently as 3.0.2 to avoid the concurrent documentation PR’s version; raw records retain their original labels.
Complete production pipelines are measured sequentially in fresh processes with four threads and matching content/order hashes. Reader order rotates and corpus order reverses. Across pandas 3.0.6 and Ensembl/GENCODE 250k-row plain/gzip inputs, three-run medians take 17–25% less time than the 2.9.1 Polars pipeline and 31–36% less time than 3.0.0. pandas 2.3.3 Ensembl medians improve; its GENCODE wall times are mixed and highly variable, so no general speedup is claimed there. Every run and range is retained.
Full-file scaling checks on pandas 3.0.6, one observation per reader:
These full-file observations take 22–32% less time and 44–48% less peak RSS than Polars. They verify scaling and correctness, rather than repeated full-file throughput. Bounded temporary assembly applies to Arrow string storage; Python/object storage retains compatible construction. This compares complete gtfparse pipelines, not pure pandas-versus-Polars engines. Imports/checksums are outside load time; RSS is captured before validation; OS caches are not flushed and the workstation is shared. The rejected unbatched candidate is retained separately and excluded from final claims.
Validation:
./lint.shand./test.sh -W error::DeprecationWarning: 213 passed, 97% coverage.Reproduction and limitations: optimization report, retained measurements, and
benchmarks/compare_releases.py.Release verification (2026-10-06):
a80b0827e982c32409d78aa707d6350374b6555a; ran./deploy.shfrom clean master. Its lint/tests passed: 213 tests, 97% coverage.gtfparse==3.0.2with pandas 3.0.6/Arrow 25 passespip check, installs/imports no Polars, and passes 20 raw/expanded plain/gzip round trips across all five fixtures. A 250,003-row read verifies the actual batch boundary, late columns, missing prefixes, collisions, repeated attributes and global progress.Next work, grouped by dependency and urgency: within gtfparse, #65 is the next foundational candidate for synthesis policy, followed by complementary completeness flags in #66. #37 is the separate route to a public streaming reader; this release still loads the fixed table. Documentation #86/#92 is already represented by PR #93, with small examples #13/#16 remaining. Downstream, PyEnsembl #445 is the smaller ID-consistency fix, while #447 is the broader unified-annotation work. Datacache’s independent adoption blockers are #88/#89; source identity #92 supports materialization #90, with inventory/pruning #91 and layout/local-input extensions #93/#94 following. These are recommendations from the issue review; no sibling repository changes were made.