Re: Localizer.forPackage() and startup time

2006-11-09 Thread Bryan Noll
+1.  Seems right to have the 'slowness' occur on the unhappy path 
instead of the happy path.


Craig L Russell wrote:

+1

Seems like the right tradeoff.

Craig

On Nov 8, 2006, at 4:22 PM, Patrick Linskey wrote:


Hi,

I'm investigating ways to optimize startup time a bit, and one thing
that I ran across is resource bundle overhead in calls to
Localizer.forPackage() calls. I'm working on a patch that defers all of
the Localizer.forPackage() overhead to the first use of the localizer,
instead of eagerly looking for data.

This will mean slightly more overhead on all Localizer method
invocations, but localization generally only happens when writing log /
error messages, so it seems like it's fair to increase the overhead in
those situations in exchange for eliminating the overhead in normal
usage (i.e., when the localizer is not used).

Since we obtain Localizer instances statically, this should speed up the
first load of any class that has a Localizer reference.

What do others think about this tradeoff?

-Patrick

--Patrick Linskey
BEA Systems, Inc.

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it.


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!



RE: Localizer.forPackage() and startup time

2006-11-09 Thread Patrick Linskey
Implemented with 473057. Man, I wish that Java had universal access
syntax.

-Patrick

-- 
Patrick Linskey
BEA Systems, Inc. 

___
Notice:  This email message, together with any attachments, may contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
entities,  that may be confidential,  proprietary,  copyrighted  and/or
legally privileged, and is intended solely for the use of the individual
or entity named in this message. If you are not the intended recipient,
and have received this message in error, please immediately return this
by email and then delete it. 

 -Original Message-
 From: Kevin Sutter [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, November 09, 2006 11:35 AM
 To: open-jpa-dev@incubator.apache.org
 Subject: Re: Localizer.forPackage() and startup time
 
 +1   Defer paying the price until it is needed.  Thanks for 
 looking into
 this.
 
 On 11/9/06, Bryan Noll [EMAIL PROTECTED] wrote:
 
  +1.  Seems right to have the 'slowness' occur on the unhappy path
  instead of the happy path.
 
  Craig L Russell wrote:
   +1
  
   Seems like the right tradeoff.
  
   Craig
  
   On Nov 8, 2006, at 4:22 PM, Patrick Linskey wrote:
  
   Hi,
  
   I'm investigating ways to optimize startup time a bit, 
 and one thing
   that I ran across is resource bundle overhead in calls to
   Localizer.forPackage() calls. I'm working on a patch 
 that defers all of
   the Localizer.forPackage() overhead to the first use of 
 the localizer,
   instead of eagerly looking for data.
  
   This will mean slightly more overhead on all Localizer method
   invocations, but localization generally only happens 
 when writing log /
   error messages, so it seems like it's fair to increase 
 the overhead in
   those situations in exchange for eliminating the 
 overhead in normal
   usage (i.e., when the localizer is not used).
  
   Since we obtain Localizer instances statically, this 
 should speed up
  the
   first load of any class that has a Localizer reference.
  
   What do others think about this tradeoff?
  
   -Patrick
  
   --Patrick Linskey
   BEA Systems, Inc.
  
   
 __
 _
   Notice:  This email message, together with any 
 attachments, may contain
   information  of  BEA Systems,  Inc.,  its subsidiaries  
 and  affiliated
   entities,  that may be confidential,  proprietary,  
 copyrighted  and/or
   legally privileged, and is intended solely for the use of the
  individual
   or entity named in this message. If you are not the 
 intended recipient,
   and have received this message in error, please 
 immediately return this
   by email and then delete it.
  
   Craig Russell
   Architect, Sun Java Enterprise System 
 http://java.sun.com/products/jdo
   408 276-5638 mailto:[EMAIL PROTECTED]
   P.S. A good JDO? O, Gasp!
  
 
 


Re: Localizer.forPackage() and startup time

2006-11-08 Thread Craig L Russell

+1

Seems like the right tradeoff.

Craig

On Nov 8, 2006, at 4:22 PM, Patrick Linskey wrote:


Hi,

I'm investigating ways to optimize startup time a bit, and one thing
that I ran across is resource bundle overhead in calls to
Localizer.forPackage() calls. I'm working on a patch that defers  
all of

the Localizer.forPackage() overhead to the first use of the localizer,
instead of eagerly looking for data.

This will mean slightly more overhead on all Localizer method
invocations, but localization generally only happens when writing  
log /

error messages, so it seems like it's fair to increase the overhead in
those situations in exchange for eliminating the overhead in normal
usage (i.e., when the localizer is not used).

Since we obtain Localizer instances statically, this should speed  
up the

first load of any class that has a Localizer reference.

What do others think about this tradeoff?

-Patrick

--
Patrick Linskey
BEA Systems, Inc.

__ 
_
Notice:  This email message, together with any attachments, may  
contain
information  of  BEA Systems,  Inc.,  its subsidiaries  and   
affiliated
entities,  that may be confidential,  proprietary,  copyrighted   
and/or
legally privileged, and is intended solely for the use of the  
individual
or entity named in this message. If you are not the intended  
recipient,
and have received this message in error, please immediately return  
this

by email and then delete it.


Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:[EMAIL PROTECTED]
P.S. A good JDO? O, Gasp!



smime.p7s
Description: S/MIME cryptographic signature