-
Notifications
You must be signed in to change notification settings - Fork 33
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
Late declarations of lower-cost conversions are ineffective #61
Comments
Just found #10 which also touches on the issue of the hidden initialization cost which resulted in the introduction of a |
The main issue here could also be solved by invalidating the memo whenver new conversions are declared. However, this wouldn't also address the performance gotcha, so I decided to break it out into its own issue. |
It's important to articulate the problem; is this a real concern for anyone? The only non-toy/demo/example I found of using This issue is currently theoretical afaict, and I don't think anyone should spend time on it. 😄 |
Declaring new conversions via
def-conversion
which would make conversion between two types less costly are ineffective if the conversion in question has occurred at least once before. This is caused by the global converter memoization which captures the state of the conversion graph at the point in time of the very first invocation for a given pair of source and dest types.Reproducer:
Output:
In contrast, moving both
run
invocations after the lastbs/def-conversion
outputs:This is a bit of a gotcha which might at least be worth documenting. Alternatively,
def-conversion
could reset the memo which should solve this issue.The text was updated successfully, but these errors were encountered: