AW: [opencms-dev] Performance Profiling Session

Emmerich, Michael Michael.Emmerich at framfab.de
Mon May 22 18:38:07 CEST 2000


Hardi,

> For now I found one interesting hotspot:
> 
> Each request to CmsXmlWpTemplateFile causes a new instance of the
> CmsXmlLanguageFile object. This is a very expensive 
> operation, because the
> very large LanguageFile must be loaded, parsed and so on 
> (cumulated about
> 60% of the whole request time).

Indeed, the CmlLanguageFile was loaded all the time there, this was a bug
and solved right now (only the file header information was needed there,
which is a much less expensive operation)
But the file was not parsed all the time, this was done only once, all later
access used the parsed file from the XML cache.

> Then I patched (it is just a demo hack!!!) the CmsXmlWpTemplateFile
> implementation and changed CmsXmlLanguageFile.m_languageFile 
> to a static.

We had used a very similar "hack" some time ago to speed up this operation
as well - but this caused some serious problems when when the parsed XML
file was accessed more than once simultaniously, it then began to mix up the
datablocks in it. (At least this is what our XML specialist told me).
So we had to return to the current implementation.

> With this hack you get more than 50 percent of speed. OK it 
> is just a hack,
> but it proves the need to do something in this spot. I 
> suggest a singleton
> class which caches all the language files ever loaded and 
> doublecheck that
> the mechanism is thread save. Furthermore there must be a way 
> to invalidate
> this cache.

As we have to take a look at our caching anyway, I guess this is one of the
critical spots we should include in some kind of caching.

Anyway, thanks for your very helpful and detailed information.

Michael Emmerich

mailto:michael.emmerich at framfab.de



More information about the opencms-dev mailing list