You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jspwiki.apache.org by Janne Jalkanen <Ja...@ecyrd.com> on 2009/01/08 17:18:57 UTC

Preferences.reloadPreferences()

Hmhmhm...

Please tell me that I'm seeing things, but are we actually reloading  
jspwiki.properties all the time?

Preferences.setupPreferences() calls PropertyReader.loadWebAppProps()  
which in turns loads jspwiki.properties.  Of course, for a regular  
user this is done once per session, but for a bot which disregards  
cookies or for someone who has cookies turned off...  That can be  
quite a significant load, and certainly slows down the site experience.

Is there something hidden here which I don't understand, or why can't  
we just simply clone WikiEngine.getWikiProperties()?

/Janne



Re: Preferences.reloadPreferences()

Posted by Harry Metske <ha...@gmail.com>.
and we probably should notice these kind of things when we run our tests,
and compare the performance results with previous results.
Which reminds me of https://issues.apache.org/jira/browse/JSPWIKI-399 , is
anyone working on that (Siegfried ?)

regards,
Harry

2009/1/8 Janne Jalkanen <Ja...@ecyrd.com>

> Hmhmhm...
>
> Please tell me that I'm seeing things, but are we actually reloading
> jspwiki.properties all the time?
>
> Preferences.setupPreferences() calls PropertyReader.loadWebAppProps() which
> in turns loads jspwiki.properties.  Of course, for a regular user this is
> done once per session, but for a bot which disregards cookies or for someone
> who has cookies turned off...  That can be quite a significant load, and
> certainly slows down the site experience.
>
> Is there something hidden here which I don't understand, or why can't we
> just simply clone WikiEngine.getWikiProperties()?
>
> /Janne
>
>
>

Re: Preferences.reloadPreferences()

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
> For example, I'd like to see it turned into a full-blown
> PreferencesManager class with an initialize() method, which would
> enable us to keep a cached clone of WikiEngine prefs (for example).
> Just thinking out loud...

It's odd that it's a static manager class.  It should probably be  
turned into a regular one.

(Caching WikiEngine properties on the other hand is probably not a  
good idea; it's just a wasted clone, if it's cloned anyway.)

/Janne

Re: Preferences.reloadPreferences()

Posted by Andrew Jaquith <an...@gmail.com>.
That certainly could be the case. When I refactored the prefs code, I
wasn't optimizing anything, simply moving it as fast as possible into
the new scheme without breaking much code. I (and Dirk too, I'll bet)
would welcome improvements.

There are probably also additional improvements to Preferences that we
could make, IF we view that code as malleable. It's fairly new code.

For example, I'd like to see it turned into a full-blown
PreferencesManager class with an initialize() method, which would
enable us to keep a cached clone of WikiEngine prefs (for example).
Just thinking out loud...

Andrew

On Thu, Jan 8, 2009 at 11:18 AM, Janne Jalkanen
<Ja...@ecyrd.com> wrote:
> Hmhmhm...
>
> Please tell me that I'm seeing things, but are we actually reloading
> jspwiki.properties all the time?
>
> Preferences.setupPreferences() calls PropertyReader.loadWebAppProps() which
> in turns loads jspwiki.properties.  Of course, for a regular user this is
> done once per session, but for a bot which disregards cookies or for someone
> who has cookies turned off...  That can be quite a significant load, and
> certainly slows down the site experience.
>
> Is there something hidden here which I don't understand, or why can't we
> just simply clone WikiEngine.getWikiProperties()?
>
> /Janne
>
>
>