friuns2 / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Performance issue serializing complicated object graph #438

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
ProtoWriter.CheckRecursionStackAndPush uses a stack to keep track of objects 
that are currently being serialized and to avoid infinite recursion. However, 
it does a linear search through the MutableList to check whether the current 
object is in the collection, and in my case this was causing a significant 
performance hit.

I've made a quick and dirty change that reduces the impact in this case. Is 
this a viable way forward?

Original issue reported on code.google.com by j...@jdh28.co.uk on 10 Apr 2014 at 2:11

Attachments: