#474 Poco::Util::Abstraction::setXXX() is slow

Feature_Request
closed
Marian Krivos
Util (37)
5
2012-09-14
2011-10-08
Marian Krivos
No

There is serious performance regression with Poco::Util::Abstraction::setXXX() and property change eventing. I wrote simple test:

int main(int argc, char argv[])
{
Poco::Util::MapConfiguration
mapConfig = new Poco::Util::MapConfiguration();

{
    Poco::Timestamp now;
    for(int i=0; i<1000000; ++i)
    {
        mapConfig->setString("key", "value");
    }
    std::cout << "With eventing : " << (Poco::Timestamp()-now)/1000. << "msecs" << std::endl;
}
{
    mapConfig->setPropertyEventingMode(false);
    Poco::Timestamp now;
    for(int i=0; i<1000000; ++i)
    {
        mapConfig->setString("key", "value");
    }
    std::cout << "Without eventing : " << (Poco::Timestamp()-now)/1000. << "msecs" << std::endl;
}

}

with output :

With eventing : 792.691msecs
Without eventing : 314.756msecs

Result is that eventing panalty is +152% for feature that is rarely (?) used. Maybe will be better set this feature as optional with mechanism to disable it with setPropertyEventingMode(false); With default set to ON.

If there will be consensus I can commit this change to the Poco trunk.

Our SW is heavily based on this feature and now starts 40 secs, instead 20 secs.

Discussion

  • added enableEvents() method to AbstractConfiguration

     
  • this was already fixed in 1.4.3, btw.