Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jdt-dev] Read access to enclosing field is emulated by a synthetic accesso r method. Increasing its visibility will improve your performance

Since you are using Windows, the timer precision is about 10msecs (at least in Win2k - could be fixed in XP). You should increase the number of iterations until you obtain a time difference where a 10msec deviation is insignificant.

Gary Gregory wrote:

Hello All,

In some code I get eclipse compiler warnings like:

Read access to enclosing field GenericObjectPool._evictionCursor is emulated by a synthetic accessor method. Increasing its visibility will improve your performance GenericObjectPool.java Jakarta Commons/pool/src/java/org/apache/commons/pool/impl line 1005

I have created the attached test in order to see what improvements we are talking about. I tried to make the test as simple as possible. On the JRE 1.4.1, sometimes but not always, using "a synthetic accessor method" is slower, sometimes faster. Can you explain what is going on here? On JRE 1.3.1, the synthetic version is always slower (good). Can this be explained away by GC? Or some other internal process?

Thank you,
Gary

Eclipse Platform
Version: 2.1.0
Build id: 200303071024

Test results:

Running Java 1.3.1_07-b02 on Windows XP 5.1 null

iterations = 1000
withWarningMsecs = 0
noWarningMsecs = 0
no difference

iterations = 10000
withWarningMsecs = 10
noWarningMsecs = 0
no warning class is faster by 10 msecs

iterations = 100000
withWarningMsecs = 10
noWarningMsecs = 0
no warning class is faster by 10 msecs

iterations = 1000000
withWarningMsecs = 30
noWarningMsecs = 20
no warning class is faster by 10 msecs

iterations = 10000000
withWarningMsecs = 290
noWarningMsecs = 241
no warning class is faster by 49 msecs

iterations = 100000000
withWarningMsecs = 2663
noWarningMsecs = 2354
no warning class is faster by 309 msecs

Done.

----------------------------------------------------------

Running Java 1.4.1_02-b06 on Windows XP 5.1 Service Pack 1

iterations = 1000
withWarningMsecs = 10
noWarningMsecs = 0
no warning class is faster by 10 msecs

iterations = 10000
withWarningMsecs = 0
noWarningMsecs = 0
no difference

iterations = 100000
withWarningMsecs = 10
noWarningMsecs = 10
no difference

iterations = 1000000
withWarningMsecs = 90
noWarningMsecs = 90
no difference

iterations = 10000000
withWarningMsecs = 811
noWarningMsecs = 821
no warning class is SLOWER by 10 msecs

iterations = 100000000
withWarningMsecs = 8152
noWarningMsecs = 8092
no warning class is faster by 60 msecs

Done.





Back to the top