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

Fix performance impact of exception handling in _is_annotation_tid() #925

Conversation

J007X
Copy link
Collaborator

@J007X J007X commented Mar 13, 2023

This PR fixes #923.

Description of changes

Related test code were added to determine details related exception (including statistics comparison with earlier code). The data shows the newly added exception handling code impact the performance most while the difference in dictionary access is insignificant so only the exception handling code is changed.

Possible influences of this PR.

Since no other place than the exception handling part is changed, the impact to other code is minimum, and the performance issue can be resolved (speed restored to previous level).

Test Conducted

Usual unit tests and profiling tests.

…ed exception (including statistics comparison with earlier code). The data shows the newly added exception handling code impact the performance most while the difference in dictionary access is insignificant so only the exception handling code is changed.
@J007X J007X requested a review from hunterhector March 13, 2023 13:09
@hunterhector
Copy link
Member

Thanks for the fix. It looks like it is not ideal to create and include a large string in the exception.

I think this PR is fine. Please fix the CI problem and we can merge it.

To avoid unnecessary turnaround due to things like "black", you could add the pre-commit-hook locally as specified here.
https://github.com/asyml/forte/blob/master/CONTRIBUTING.md#coding-style

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Merging #925 (e2735a8) into master (6e2d6ea) will not change coverage.
The diff coverage is 66.66%.

@@           Coverage Diff           @@
##           master     #925   +/-   ##
=======================================
  Coverage   81.05%   81.05%           
=======================================
  Files         256      256           
  Lines       19851    19851           
=======================================
  Hits        16091    16091           
  Misses       3760     3760           
Impacted Files Coverage Δ
forte/data/data_store.py 93.31% <50.00%> (ø)
forte/data/ontology/ontology_code_generator.py 89.75% <100.00%> (ø)

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

@hunterhector
Copy link
Member

ci not passed yet.

@hunterhector hunterhector merged commit ae14581 into asyml:master Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants