[
https://issues.jboss.org/browse/RTGOV-329?page=com.atlassian.jira.plugin....
]
Gary Brown updated RTGOV-329:
-----------------------------
Attachment: Performance.java
(1) Clear vs allocation
Results:
{noformat}
TIME TAKEN (clear) arraysize=10 iterations=1000: 31
TIME TAKEN (alloc) arraysize=10 iterations=1000: 4
-----
TIME TAKEN (clear) arraysize=10 iterations=1000: 0
TIME TAKEN (alloc) arraysize=10 iterations=1000: 1
-----
TIME TAKEN (clear) arraysize=100 iterations=1000: 7
TIME TAKEN (alloc) arraysize=100 iterations=1000: 15
-----
TIME TAKEN (clear) arraysize=1000 iterations=1000: 36
TIME TAKEN (alloc) arraysize=1000 iterations=1000: 40
-----
TIME TAKEN (clear) arraysize=10000 iterations=1000: 448
TIME TAKEN (alloc) arraysize=10000 iterations=1000: 699
-----
TIME TAKEN (clear) arraysize=100000 iterations=1000: 3518
TIME TAKEN (alloc) arraysize=100000 iterations=1000: 3649
-----
{noformat}
The first pair of results are just startup costs - so this test is repeated and the second
run shows the more realistic results.
So it shows with array sizes up to 100000, using clear performs better than reallocating
each time.
Consider refactoring/cleanup of ActivtyServerLogger
---------------------------------------------------
Key: RTGOV-329
URL:
https://issues.jboss.org/browse/RTGOV-329
Project: RTGov (Run Time Governance)
Issue Type: Quality Risk
Security Level: Public(Everyone can see)
Components: Activity Collector
Affects Versions: 1.0.0.Final
Reporter: Jiri Pechanec
Assignee: Gary Brown
Fix For: 2.1.0.Final
Attachments: Performance.java
1) I consider the code to be overcomplicated - are we really getting any performance
boost with reusing the ArrayList of events? I found on the web that clear() might be even
slower than new allocation
2) There is unsynced access to fields _sequenceNumber and _failuresSinceLastSuccess
3) I am not sure if it is wise to mix synchronization on Java level - _timer in
BatchedActivityUnitLogger - and Java EE level - method synchornization on @Singleton
--
This message was sent by Atlassian JIRA
(v6.2.6#6264)