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

Generating objects - use more than one thread #57

Open
halotron opened this issue Sep 21, 2016 · 5 comments
Open

Generating objects - use more than one thread #57

halotron opened this issue Sep 21, 2016 · 5 comments

Comments

@halotron
Copy link

It takes a considerable time to serialize some objects graphs. It would be nice if the serialization could be paralellized.

@OmarElabd OmarElabd self-assigned this Sep 21, 2016
@OmarElabd OmarElabd added this to the Version 2.0 milestone Sep 21, 2016
@OmarElabd
Copy link
Owner

@halotron that's a very good idea to have multiple threads work to serialize the child objects. It certainly is a task that seems like it can be parallelized, but since the object that i use to serialize is a com object taken from the visual studio debugger there may be some issues with running multiple threads. I'll have to investigate and see if it's possible.

Are you running object exporter on large objects with a deep hierarchy?

@halotron
Copy link
Author

Ok. Well I capped it to level 2 and had to abort it since it took too long to complete. They are not very complex EF-objects with some lazy loading going on I think. I cant really switch lazy loading off just for serialization. But since the load was 100% on one core only I guessed there could be room for some paralellization.

@Pecral
Copy link

Pecral commented Nov 3, 2016

@OmarElabd Do you think that the performance is related to the usage of the Env.DTE expression interface instead of the IDebugProperty2/3 mentioned in #46?

I'm currently working on a project which uses the Env.DTE expression too and I've got some performance problems as well as problems in separating the expensive work into a second thread so that my interface doesn't get blocked. I've never worked very much with COM-objects though, that could be the problem.

@OmarElabd
Copy link
Owner

OmarElabd commented Nov 4, 2016

Hey @Pecral, I'm not sure if switching to IDebugProperty will significantly affect performance since they are both com objects. I would recommend creating C# objects from values retrieved from the Env.DTE or IDebugProperty com objects (might need to set a depth max). Constructing the C# objects can probably be parallelized using more than one or two threads. Once you have representative C# objects, you should be good. This is the approach I am taking for v2.

@Pecral
Copy link

Pecral commented Nov 6, 2016

Hey @OmarElabd, yes you're right, that's the way my extension works currently. Once the representative C# objects are created, the performance is fine because the data is cached. The problem occurs when querying 100+ expressions plus their child-expressions (i.e. a large list of complex objects), which has to happen in one feature of my program. My attempts at parallelization as well as preventing that the GUI gets blocked weren't successfull yet. I'm excited to see how it'll work out for you! I guess the latter isn't really a problem for you though (I think in the current version the wait-window just gets a bit laggy).

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