Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Inefficient operations to avoid #365

Closed
ice1000 opened this issue Mar 29, 2021 · 3 comments
Closed

Inefficient operations to avoid #365

ice1000 opened this issue Mar 29, 2021 · 3 comments
Assignees
Labels
performance Optimize tycking question Further information is requested

Comments

@ice1000
Copy link
Member

ice1000 commented Mar 29, 2021

I noticed some (can be optimized in obvious ways) inefficient operations used in the codebase of Aya. Here's a list of them I could recall rn:

  • Applying multiple substitution on a term before using it. Substitution on a term should be batched to apply once. Each substitution is a traversal of the AST and a reconstruction of the substituted part, which is really bad.
    • As an example, in ExprTycker::visitApp, the instPi call substitutes the telescope EACH TIME we traverse an argument. This is really really bad. We should only substitute ONCE for each element in the telescope. This could be refactored out easily.

Reference: AndrasKovacs/elaboration-zoo#7 (comment)

@ice1000 ice1000 added the question Further information is requested label Mar 29, 2021
@ice1000 ice1000 added this to the 0.6 milestone Mar 29, 2021
@ice1000
Copy link
Member Author

ice1000 commented Mar 31, 2021

I'm thinking about this again. I think a benchmark comparison for substitution will be very interesting to do. I think we could do that. Let's delay the optimization to the time we have small libraries.

I think for now, we could optimize prepend out first.

@ice1000 ice1000 removed this from the 0.6 milestone Mar 31, 2021
@ice1000 ice1000 added the performance Optimize tycking label Mar 31, 2021
@ice1000 ice1000 pinned this issue Apr 9, 2021
@ice1000
Copy link
Member Author

ice1000 commented Sep 20, 2021

This does not seem like an issue

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
performance Optimize tycking question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants