colcon / colcon-core

Command line tool to build sets of software packages
http://colcon.readthedocs.io
Apache License 2.0
107 stars 46 forks source link

Re-work EmPy token caching #662

Closed cottsay closed 2 months ago

cottsay commented 2 months ago

The previous approach was to re-implement Interpreter.parse() to iterate over cached tokens where possible. This proved to be a problem when the implementation changed in EmPy 4.x.

The approach implemented here is to create a shim between the Interpreter and Scanner API and record/inject the tokens there, which improves the compatibility by working only at the API boundary and not duplicating chunks of the upstream implementation.

Note that I haven't actually benchmarked either of these caching implementations. They may not be worth the complexity.

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.36%. Comparing base (4d7ab92) to head (1e6c9b9). Report is 2 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #662 +/- ## ========================================== + Coverage 87.34% 87.36% +0.01% ========================================== Files 67 67 Lines 3913 3917 +4 Branches 776 775 -1 ========================================== + Hits 3418 3422 +4 Misses 391 391 Partials 104 104 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.