Skip to content

Reference assembly loading fixes #415

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

Merged
merged 1 commit into from
Mar 11, 2025
Merged

Reference assembly loading fixes #415

merged 1 commit into from
Mar 11, 2025

Conversation

Thorium
Copy link
Member

@Thorium Thorium commented Feb 17, 2025

  1. I noticed that if I had 139 reference assemblies (in a solution memory), I ended up calling the Assembly.Load for 897 times. This is because so many assemblies have the same references like System.Memory, System.Xml, System.Buffers, System.Threading.Tasks.Extensions, ... And the code said "load all reference assemblies". Simple fix: Check already loaded reference assemblies before trying to call the slow Assembly.Load again.

  2. The sourceAssembliesTable_ is a ConcurrentDictionary to ensure thread-safety. However, instead of code using it in thread-safe way, it was used by double-lookup. So that is fixed to actually use it properly. (It's role is to be used as a guard to sourceAssemblies_ array, which is manually lazy-loaded from the queue.)

…eady loaded, 2) Use ConcurrentDictionary in thread-safe way
@dsyme dsyme merged commit 9e8239f into fsprojects:master Mar 11, 2025
2 checks passed
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