XML Key/Value Cache Optimizations

For a read-only XML file server with a simple path-based addressing scheme, I initially used ConcurrentDictionary<string, XElement> as a key/value cache. This generated and kept constantly in memory a lot of unnecessary XAttribute and XElement instances which contributed nothing to raw data transfers across the wire. Considering the fact that resident XAttribute or XElement instances in the file server process were totally useless because we do indexing and serve result paths via our query server, I switched to using path-indexed string buffers with path-to-segment dictionaries as the new key/value cache.

Memory footprint for hundred documents, before/after

My question on Stackoverflow.com with some code

http://stackoverflow.com/questions/3613713/how-to-get-stream-positions-of-xml-elements-in-net

Full working environment screenshots ^__^

Posted via email from CORSIS

Comments

Popular posts from this blog

Levenshtein Distance Algorithm: Fastest Implementation in C#

Mono 1.2.5 binaries for Solaris 10/x86

WordSmith Tools 5.0, Tenka Text in China