mapnik/mapnik — pull request #1723 by springmeyer (2013-02-20 21:31:14+00:00)
Title: Fix rendering rule cache of active rules for a given zoom level

A rule cache was added as part of #916.

The design is not optimal because style object (`feature_type_style`) should not be modified during rendering and in this case the usage of `const_cast` is not ideal.

I did some quick testing of rendering osm based maps with lots of rules and did not see any measurable benefit to caching rules (likely because the benefit it small enough not to rise above the noise).

However, I like the idea of having objects to encapsulate more of the verbose code in feature_style_processor.

So, this pull keeps the idea of a `rule_cache` object but moves it to being created on the fly during rendering. In this case rules will not be cached for successive renders at the same zoom level, but I really don't think that is an important optimization. However, avoiding looping over active rules more than once during rendering makes sense and this pull implements that nicety.