Skip to content

Performance Enhancements Redux #39

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

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

mwm-deriv
Copy link

This is a replacement PR for #38 which I handled very poorly before it got merged.

It is ready for merge with appropriate approvals already on the original.

We lose the ability to interpolate sub-expressions, but this avoids a
recompilation on each evalulation which is approximatiely as expensive
as doing the match itself.
FETCH and STORE operations can be surprisingly expensive with at tied
LRU cache. In fact, they are slower than just building a new object.

On the other hand, there may be cached attribute build which would also
improve things for using those objects.

I cannot believe that the hit rate for those will be able to dominate
this storage and retrieval problem.
The major differences from a consumer perspective are:

- `epoch` is no longer checked for proper type
- Attempting to build an object from another object actually returns a
  new object, not the same one

These are consequences of te diffeence between Moo and Moose.  But they
seem, to me, inconsequential.
- Use early returns to make it obvious what we are doing
- Don't preallocate a hashref which is directly returned
- Reorder based on expected usage
- Reduce checks inside a provided hashref
This organization reflects ease of matching (shorter is better) and
liklelihood of match (more often is better)
- Changes file updated
- Makefile.PL updated by dzil
	Remove dependency on Tie::Hash::LRU
	Switch dependency from Moose to Moo
	Improve datatime parsing performance
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.70%. Comparing base (5af2c52) to head (bd59a81).
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master      #39      +/-   ##
==========================================
+ Coverage   89.74%   92.70%   +2.95%     
==========================================
  Files           1        1              
  Lines         273      274       +1     
  Branches       38       41       +3     
==========================================
+ Hits          245      254       +9     
+ Misses         17       10       -7     
+ Partials       11       10       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants