mardi 19 mai 2015

Any ideas on how to implement a SUPER FAST generic .NET object dirty check? [duplicate]

This question already has an answer here:

I'm looking for a super fast way to perform a generic dirty check on .NET object's (public fields and properties). I'm now using a combination of serializing and a hashing algorithm. Mostly because that was functionality that was already there. But it just sounds a bit slow. The serializing takes too much time (more than it should have to) and memory. When the serialization is done (weak) 'cryptographic' hashing is performed. But I don't need cryptographic hashing as it has nothing to do with security it's just dirty checking.

It's no problem to build something completely from scratch,.. I don't have to use functionality that's already there. Still it would be nice if there was a ready-made solution that I could just use.

Right now my mind is sort of playing around with some way of 'compiling' a Type definition using reflection to a dirty check (possibly using some hash extraction) 'thingy' ... but it hasn't yet materialized.





Aucun commentaire:

Enregistrer un commentaire