Skip to content

Conversation

@lukecotter
Copy link
Contributor

perf: use weak map to track circular refs

Instead of a list. On a large tree with a circular ref on every node this took deep clone from > 5 mins (I stopped counting here) to < 3 sec for me.

Instead of a list. On a large tree with a circular ref on every node
this took deeop clone from > 5 mins to < 1 sec for me.
@rathboma
Copy link
Collaborator

@lukecotter This does change the behavior though right? It changes it from using .copy to using the reference directly. Is that intentional? What are the side effects of that?

@lukecotter
Copy link
Contributor Author

@rathboma oof I forgot to add to the map. It’s in my local copy I will sort asap. Sorry about that.

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