Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#290 - Speedup load_cas_from_xmi by improving offset mapping #291

Conversation

DavidHuebner
Copy link
Collaborator

@DavidHuebner DavidHuebner commented Sep 20, 2023

  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
Copy link

codecov bot commented Sep 20, 2023

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%) ⬇️
cassis/xmi.py 96.72% <100.00%> (+<0.01%) ⬆️

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

…o#290-Speedup_load_cas_from_xmi_by_improving_offset_mapping:

1.Added an LRU Cache is used 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.
@reckart
Copy link
Member

reckart commented Oct 4, 2023

Thanks for the PR :)

@reckart reckart changed the title #290-Speedup_load_cas_from_xmi_by_improving_offset_mapping #290 - Speedup load_cas_from_xmi by improving offset mapping Oct 4, 2023
@reckart reckart merged commit ed6b4f5 into dkpro:main Oct 4, 2023
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants