Skip to content

Conversation

@thetarnav
Copy link
Contributor

Related to #1049
It avoids cloning the AST nodes when collecting symbols.
Previously the files were parsed using a temporary allocator, and then cloned to a collection allocator when collecting symbols.
Now the file is parsed using the collection allocator directly, and then just the strings in the AST are copied to the collection allocator later—the source code is freed after the request.

This works quite well and even makes tests run faster for me—from ~950ms to ~800ms.

@BradLewis
Copy link
Collaborator

I had a play around with this and I noticed that the memory usage increases by a few megabytes everytime a save a file, even without changes. Saving the analysis.odin file increases the usage by ~7-8mb per save.

@thetarnav
Copy link
Contributor Author

right.. there should more memory used for the ast, and it's not freed entirely, as only ast nodes of symbols are freed, but that seems like a lot.

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