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

Core.RemoveObjectFromList performance #221

Open
juflo opened this issue Oct 10, 2018 · 1 comment
Open

Core.RemoveObjectFromList performance #221

juflo opened this issue Oct 10, 2018 · 1 comment

Comments

@juflo
Copy link

juflo commented Oct 10, 2018

Hi

When an NetOffice COMObject is disposed, its children are also disposed : the method Core.RemoveObjectFromList is called.
The problem is the _globalObjectList in Core is of type List, which is of complexity O(n²) when calling list.Remove(child) : it's really slow.
It should be possible to use a HashSet instead to achieve far better performance.

@juflo juflo changed the title Dispose perfomance Core.RemoveObjectFromList perfomance Oct 10, 2018
@GuoHuiChen
Copy link

Yes , I always dispose the COM Objects as soon as possible, use using(var a = ....){}

@jozefizso jozefizso changed the title Core.RemoveObjectFromList perfomance Core.RemoveObjectFromList performance Jun 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants