On Thu, Jul 24, 2008 at 8:57 AM, bob <
sabob1@...> wrote:
> Have removed these checks and updated certain Controls to cache the
> Context locally inside methods where it was reused more than once.
>
> Still I doubt this makes any real difference to running apps ;-)
That's good. I have also checked in changes to cache the context as a
transient variable in the Page and AbstractControl. This instance
variable is cleared in their respective onDestroy() methods. This
pretty well eliminates the threadlocal lookup cost around for the
Context object.
I have given these variables private scope, as we dont wan't people
referencing them directly. People will also have to ensure they call
super.onDestroy() in their Page and Control subclasses in their
onDestroy methods if they use stateful pages.
For the Menu control I had to do a ThreadLocal lookup in getContext()
as the cached rootMenu is static and clearing the context in
onDestroy() method caused NPE with multi-threaded access.
> Wonder if the escapeHtml algorithm can be enhanced as that is what is
> showing up in Yourkit.
>
> Another enhancement is making column id generation optional. The only
> use case I know of for this feature is Selenium tests. Not sure many
> folk need them id's by default...
You know I think that is a good idea, should probably follow the
Column sortable pattern for this:
/**
* Return the column sortable status. If the column sortable status is not
* defined the value will be inherited from the
* {@link Table#sortable} property.
*
* @return the column sortable status
*/
public boolean getSortable() {
if (sortable == null) {
if (getTable() != null) {
return getTable().getSortable();
} else {
return false;
}
} else {
return sortable.booleanValue();
}
}
I have been profiling the HtmlStringBuffer with the Click Examples |
Advanced Table example and Jrat was showing awful escaping performance
around the ActionLink href attributes. I find it a bit hard to
comprehend why this is so expensive, and I wonder if it is an artifact
of Jrat. Anyway I have added a
HtmlStringBuffer#appendAttributeEscaped(String, Object) method for
explicitly escaping attribute values. This pretty well fixes this
performance issue. While it might sound like a fringe case, this
table pattern with link decorators is very common in our code.
Please keep an eye out of any issues this may introduce in the M3 release.
> Malcolm Edgar wrote:
>> Yes that is correct, they are redundant now.
>>
>> regards Malcolm Edgar
>>
>> On Wed, Jul 23, 2008 at 10:15 PM, bob <
sabob1@...> wrote:
>>> There are a couple of checks for context availability. I assume these
>>> checks were used prior to having context available on the ThreadLocal?
>>> Meaning these checks can be removed?
>>>
>>> -------------------------------------------------------------------------
>>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>>
http://moblin-contest.org/redirect.php?banner_id=100&url=/>>> _______________________________________________
>>> Click-development mailing list
>>>
Click-development@...
>>>
https://lists.sourceforge.net/lists/listinfo/click-development>>>
>>
>> -------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
>> Build the coolest Linux based applications with Moblin SDK & win great prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the world
>>
http://moblin-contest.org/redirect.php?banner_id=100&url=/>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
>
http://moblin-contest.org/redirect.php?banner_id=100&url=/> _______________________________________________
> Click-development mailing list
>
Click-development@...
>
https://lists.sourceforge.net/lists/listinfo/click-development>
regards Malcolm Edgar
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Click-development mailing list
Click-development@...
https://lists.sourceforge.net/lists/listinfo/click-development