Angus Leeming wrote:
Abdelrazak Younes <[EMAIL PROTECTED]> writes:
Abdelrazak Younes wrote:
Could someone please test this under Linux?
Enrico, if you could test it under Cygwin as well, that would be great.
Take this patch if you want to see some debug outputs. It's working
perfectly here and it's really a _huge_ performance boost under Windows!
Doesn't your cache need to take account of the language?
The Message class is designed for a unique language. If a new language
is asked, a new instance of the class will be created (see
updateDocLang()) and the old one ditched (via the scoped_ptr). In
effect, this means that the current cache will be erased. In practice,
this doesn't matter much as the cache will be filled in again at the
next paragraph break if the langauge is changed inside a section. This
does not happens much and I reckon that the delay is OK if there is a
language change. If not, then we can cache Message objects instead of
ditching them upon language change.
That's what gettext
is doing internally...
The problem is that we can't use this internal cache because.
Ie, the key shouldn't be just a string but rather
pair<string, language>.
If there is a need to do that my idea would be to maintain a map of
<language, Message> at the Buffer level. See above.
Abdel.