Skip to content

Micro-optimizations#127

Merged
cmdcolin merged 11 commits intomainfrom
bench_new
Apr 27, 2026
Merged

Micro-optimizations#127
cmdcolin merged 11 commits intomainfrom
bench_new

Conversation

@cmdcolin
Copy link
Copy Markdown
Collaborator

Avoids some pointer indirections while parsing bam records by

  • sharing dataview across record instances
  • using byteStart, byteEnd instead of bytes.start, bytes.end
  • reduces some per-instance memory usage
  • switches to use TextDecoder instead of for loops...needs more benchmarking but has been shown to be about same speed and it is simpler to use, and bets on the native performance of textdecoder more than js code

cmdcolin and others added 2 commits April 27, 2026 13:36
- Simplified exports and removed redundant types declarations
- Standardized build scripts to use pnpm consistently
- Added main field for backwards compatibility
- Removed redundant module field
- Standardized tsconfig with strict TypeScript and es2022 target
- Fixed type errors and infrastructure issues where applicable

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
cmdcolin and others added 5 commits April 27, 2026 13:59
Modern fork with better performance and fewer dependencies.
Updates eslint config to use import-x rules.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Better type safety for array/object access.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Extract _isCGTagPattern() to deduplicate identical CG-detection logic
  from _computeLengthOnRef and _computeNumericCigar
- Read flag_nc once per CIGAR compute method, deriving both the unmapped
  check and numCigarOps from a single DataView call
- Deduplicate the Z/H null-terminator scan loop in _findTag (scan once,
  then branch on isMatch)
- Replace @ts-ignore with @ts-expect-error in toJSON

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
opts has a default value so it is never undefined

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cmdcolin cmdcolin merged commit fffe9f5 into main Apr 27, 2026
1 check passed
@cmdcolin cmdcolin deleted the bench_new branch April 27, 2026 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant