Unless I'm missing something, the caching performance is abysmal. How do I implement my own disk caching mechanism to override the built-in one? Also, can I tile the images that appear in the cache, rather than have to wait until the entire extent is loaded?
Cache performance
Gregory,
There are 2 kinds of Cache in Desktop Edition. One is caching the tiling images on the disk for a LayerOverlay, with that cache, if a tiling image exists on the disk, it doesn’t need to be drawn again. This Cache has a high performance and the code is like this.
winformsMap1.StaticOverlay.ClientCache.CacheDirectory = “MyCacheFolder”;
There is another kind of Cache----FeatureCache, the default FeatureCache almost does nothing and it is supposed to be overwritten and customized. You can create your own FeatureCache class inheriting from FeatureCache, and set it’s object to FeatureSource.GeoCache property. This class is supposed to optimize the feature source. For example, if I’m using an Oracle Feature Source, I can get all the features to memory or local disk in GeoCache so I don’t need to connect to the remote Oracle Server. This cache needs a good algorithm and usually it’s difficult.
I think the first GeoCache should work fine with your cases. Let me know if you have more issues.
Thanks,
Ben
Thanks for your reply, Ben. In my non-scientific findings, using the first approach:
winformsMap1.StaticOverlay.ClientCache.CacheDirectory = "MyCacheFolder";
... doesn't seem to provide much improvement in performance because of cache misses. All you have to do is zoom in or out, or change the extent by a small degree, to cause a cache miss.
Do you not support threshold levels and tiling in this version of the product? AFAICT the Windows control is neither tiled nor multi-threaded. In addition, using thresholds increases the likelihood of a cache hit. Please advise.
Gregory,
Thanks for your suggestion! You are right that the multi-threading improves the tiling performance. In fact in the previous version 3.0.184, multi-threading is involved and we support the dynamic panning (the blank part will be filled in tile by tile before the mouse is released) that time. Unfortunately multi-threading bring us many new issues and we have to turn it off in the current 3.0.199 version. We are still working on it and will add it back in the future release when we are ready.
About tiling, we are using it in the current version and if the ClientCache is on, it does work. One thing need to remind here is that if you only have a few layer, the cache doesn’t help too much. It only helps significantly when using many layers. I had a test with 3 layers (Samples->Labeling->DrawAndLabelWaterFeatures), the performance is almost the same when turning on the Cache; but when working with World Map Kit which has hundreds of layers, I can tell the differences easily.
Hope that helps.
Thanks,
Ben