dkpro / dkpro-cassis

UIMA CAS processing library written in Python
https://pypi.org/project/dkpro-cassis/
Apache License 2.0
85 stars 22 forks source link

#290 - Speedup load_cas_from_xmi by improving offset mapping #291

Closed DavidHuebner closed 1 year ago

DavidHuebner commented 1 year ago
  1. Added an LRU Cache for speeding up the encode function and refactored the create_offset_mapping
  2. When reading a CAS-XMI, directly pass down the offset mappings to avoid recomputing them.

Reduced the time spent in create_offset_mapping from 49% to 8%.

codecov[bot] commented 1 year ago

Codecov Report

Merging #291 (970a6b7) into main (4dda3bd) will decrease coverage by 0.01%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #291      +/-   ##
==========================================
- Coverage   95.12%   95.11%   -0.01%     
==========================================
  Files           5        5              
  Lines        1968     1966       -2     
==========================================
- Hits         1872     1870       -2     
  Misses         96       96              
Files Changed Coverage Δ
cassis/cas.py 95.67% <100.00%> (-0.04%) :arrow_down:
cassis/xmi.py 96.72% <100.00%> (+<0.01%) :arrow_up:

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

reckart commented 1 year ago

Thanks for the PR :)