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

Issue #3579: Incomplete draft of a solution #3580

Closed
wants to merge 1 commit into from

Conversation

vrpolakatcisco
Copy link

Employ memoization to speed up tag filtering.

  • This is a first draft.
  • Unit tests not edited at all.
  • Not sure about storing to self._memo everywhere.
  • Not sure if normalization is applied everywhere needed.
  • Normalization applied in most places.
  • Memo dictionary is passed from callers, created empty if needed.
  • Memo dictionary uses normalized pattern or tag as the key.
  • Multiple copies of the same pattern for SingleTagPattern do not duplicate matchers.
  • Each such matcher has memo dictionary to store (normalized) tag match results.
  • Calls to the same matcher with the same tag return the memoized result.
  • Matcher memo should probably have different name than result memo.

Signed-off-by: Vratko Polak vrpolak@cisco.com

Employ memoization to speed up tag filtering.

- This is a first draft.
- Unit tests not edited at all.
- Not sure about storing to self._memo everywhere.
- Not sure if normalization is applied everywhere needed.
+ Normalization applied in most places.
+ Memo dictionary is passed from callers, created empty if needed.
+ Memo dictionary uses normalized pattern or tag as the key.
+ Multiple copies of the same pattern for SingleTagPattern do not duplicate matchers.
+ Each such matcher has memo dictionary to store (normalized) tag match results.
+ Calls to the same matcher with the same tag return the memoized result.
- Matcher memo should probably have different name than result memo.

Signed-off-by: Vratko Polak <vrpolak@cisco.com>
@codecov-commenter
Copy link

codecov-commenter commented May 22, 2020

Codecov Report

Merging #3580 into master will decrease coverage by 49.49%.
The diff coverage is 12.50%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master    #3580       +/-   ##
===========================================
- Coverage   74.21%   24.73%   -49.48%     
===========================================
  Files         199       54      -145     
  Lines       16466     3847    -12619     
  Branches     2653      697     -1956     
===========================================
- Hits        12218      951    -11267     
+ Misses       3817     2871      -946     
+ Partials      431       25      -406     
Impacted Files Coverage Δ
src/robot/model/filter.py 3.08% <0.00%> (-96.92%) ⬇️
src/robot/utils/match.py 33.77% <14.82%> (-62.38%) ⬇️
src/robot/model/testsuite.py 3.58% <0.00%> (-96.42%) ⬇️
src/robot/output/logger.py 2.34% <0.00%> (-90.05%) ⬇️
src/robot/output/output.py 2.23% <0.00%> (-84.44%) ⬇️
src/robot/model/__init__.py 21.43% <0.00%> (-78.57%) ⬇️
src/robot/utils/robottime.py 18.78% <0.00%> (-76.24%) ⬇️
src/robot/utils/frange.py 20.00% <0.00%> (-74.28%) ⬇️
src/robot/utils/recommendations.py 23.69% <0.00%> (-73.68%) ⬇️
src/robot/utils/unic.py 23.81% <0.00%> (-73.01%) ⬇️
... and 187 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 06d16e4...26c8c19. Read the comment docs.

@pekkaklarck
Copy link
Member

Based on the comment in #3579 this attempt didn't work.

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.

None yet

3 participants