Skip to content

Speed up GlyCAM IUPAC parsing - #49

Merged
fubin1999 merged 2 commits into
mainfrom
perf-glycam
Aug 15, 2026
Merged

Speed up GlyCAM IUPAC parsing#49
fubin1999 merged 2 commits into
mainfrom
perf-glycam

Conversation

@fubin1999

Copy link
Copy Markdown
Member

Summary

Speed up parse_glycam_iupac() by reusing its monosaccharide mapping across all residues in an input vector. This brings GlyCAM throughput into the same range as the other IUPAC parsers without changing parsing behavior or public APIs.

Rational

Profiling showed that rebuilding glycam_iupac_mono_map() for every residue accounted for approximately 96% of GlyCAM normalization time.

Details

  • Build the GlyCAM monosaccharide map once per input vector.
  • Pass the shared map through the internal token and monosaccharide converters.
  • Document the performance improvement in NEWS.md.

Verification

  • 300 distinct corpus structures: 24.4 to 132.9 structures/second.
  • Median runtime: 12.319s to 2.258s, a 5.46x speedup.
  • Canonical values and semantic graphs matched for all 300 structures.
  • All 6,816 matched corpus records normalized successfully.
  • Full test suite: 1,658 passed.
  • R CMD check: 0 errors, 0 warnings; one environment-only system-clock NOTE.

Reuse the compiled monosaccharide mapping across every residue in an input vector instead of rebuilding it per token.
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@fubin1999

Copy link
Copy Markdown
Member Author

@codex review

@fubin1999
fubin1999 marked this pull request as ready for review August 15, 2026 03:40
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: e5be9a3ec7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@fubin1999
fubin1999 merged commit fa0c158 into main Aug 15, 2026
13 checks passed
@fubin1999
fubin1999 deleted the perf-glycam branch August 15, 2026 03:56
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