Skip to content
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

AssemblyScanning exclusion list slows down the endpoint startup #6820

Closed
danielmarbach opened this issue Aug 30, 2023 · 0 comments · Fixed by #6814
Closed

AssemblyScanning exclusion list slows down the endpoint startup #6820

danielmarbach opened this issue Aug 30, 2023 · 0 comments · Fixed by #6814
Labels

Comments

@danielmarbach
Copy link
Contributor

danielmarbach commented Aug 30, 2023

Describe the bug

Description

When excluding a larger set of assemblies the assembly scanner scanning algorithm efforts to try to check the assemblies excluded exponentially grows which leads to significantly longer than necessary endpoint creation times.

Expected behavior

While it is expected that the longer the exclusion list is the more time might be required to check the scanned assemblies against the exclusion list it is still surprising to see an exponential growth in exclusion checks.

Actual behavior

Then endpoint creation time is significantly slower than expected.

Versions

All supported versions of NServiceBus

Steps to reproduce

Create an endpoint with a few assemblies to scan and observe relatively fast assembly scanning and thus endpoint creation time.

Add a larger exclusion list with assembly names that do not necessarily match the scanned assemblies and observe how the assembly scanning and thus endpoint creation time get orders of magnitude longer.

var scanner = endpointConfiguration.AssemblyScanner();
scanner.ExcludeAssemblies("MyAssembly1.dll", ...,"MyAssembly70.dll");

Relevant log output

No response

Additional Information

Workarounds

Possible solutions

Additional information

Backported to

@danielmarbach danielmarbach changed the title AssemblyScanning exclusion list matching inefficiency slows down scanning significantly AssemblyScanning exclusion list matching inefficiency slows down the endpoint creation significantly Aug 30, 2023
@danielmarbach danielmarbach changed the title AssemblyScanning exclusion list matching inefficiency slows down the endpoint creation significantly AssemblyScanning exclusion list slows down the endpoint startup Sep 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant