PLinq Performance Tip

When using PLinq
Memory Allocations can be the bottleneck.

Anonomous types/reference types are allocated on the heap and will have to be garbage collected.
The garbage collector was designed with low latency/fast UI thread design considerations.
Try to use value types.
Or in the app.config add

<gcserver enabled=”true”/>

This enables server mode garbage collection.
Typically workstation mode gc is the fastest, but when we deal with parellism and garbage collection across multiple processors server garbage collection can reap significant performance improvements.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s