Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

  1. assuming that a given topic is in the forum at all, the result from hasPreviousTopic will always be "true" after the first iteration.
  2. the result of hasNextTopic will always be"true" unless it is the last topic
    possible fix: change loops to...
    Code Block
    titlefor hasNextTopic()
    return (topics.size()>1 && !((Topic)topics.get(topics.size()-1)).equals(topic));
    Code Block
    titlefor hasPreviousTopic()
    return (topics.size()>1 && !((Topic)topics.get(0).equals(topic));

getDecoratedTopic

  1. save the results of previous invocations at the least. This should alone reduce CPU load spent in the parent method by 50% and response times by about %30 (4 seconds)
    possible fix: save results of the above to method calls.

results of changes:

48% of cpu time spent in getDecoratedTopic is in hasNextTopic
39% of cpu time spent in getDecoratedTopic is in hasPreviousTopic
total response time decreased to as much little as 40%

Load testing should reveal real numbers.