Skip to content

Conversation

@poke1024
Copy link
Contributor

Outputting parts of a list recomputes the format for everything each time an output happens.

Thus, outputting x=Partition[Range[10000], 5], x, Drop[x] always calls do_format on each node of the whole tree.

For XML data of a few KB do_format alone takes 1 to 2 s on my machine.

This PR caches do_format for trees and sub trees that were already output once. This depends on #575 as without it, a whole tree traversal is needed to check the cache, which invalidates the benefit.

@GarkGarcia GarkGarcia added the needs rabase An old PR that needs to be rebased label Sep 9, 2020
rocky added a commit that referenced this pull request Sep 29, 2020
Rebase Adds a cache for do_format (#580)
@rocky rocky merged commit 1caf6ae into mathics:master Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs rabase An old PR that needs to be rebased performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants