You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by "Jarkko Viinamäki (JIRA)" <de...@velocity.apache.org> on 2009/09/18 20:04:16 UTC

[jira] Commented: (VELOCITY-731) Velocity 1.6 performance is degraded by introduced toString() calls

    [ https://issues.apache.org/jira/browse/VELOCITY-731?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12757304#action_12757304 ] 

Jarkko Viinamäki commented on VELOCITY-731:
-------------------------------------------

I know this is a closed issue but here goes anyway.

I would expect that this fragment:

#if( $foobar )
 ....

merely tests whether the reference is valid (does the key exist in the context or does the path $foobar.name.Customer refer some non-null instance).

But I would not expect it to call toString on that object (which should always return non-null value anyway).

Thus I would prefer the old behaviour as the default. 

What are the use cases for this toString() == null check?

> Velocity 1.6 performance is degraded by introduced toString() calls
> -------------------------------------------------------------------
>
>                 Key: VELOCITY-731
>                 URL: https://issues.apache.org/jira/browse/VELOCITY-731
>             Project: Velocity
>          Issue Type: Bug
>          Components: Engine
>    Affects Versions: 1.6, 1.6.1, 1.6.2
>         Environment: Apache Velocity 1.6.2
>            Reporter: Jörgen Rydenius
>             Fix For: 1.6.x, 1.7
>
>         Attachments: configurable_tostring_nullcheck_patch.txt
>
>
> As part of VELOCITY-531, r686428 introduced frequent calls to toString() just to check if toString() != null. If toString() implementations are slightly complex, and very frequently executed, these calls will degrade the site performance. Are they at all necessary? What kind of object would use null as a return value for toString()? Is it possible to remove these toString() calls from the velocity code again?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@velocity.apache.org
For additional commands, e-mail: dev-help@velocity.apache.org