You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2009/11/22 06:58:17 UTC

DO NOT REPLY [Bug 48259] New: Improve StatCalculator performance by using HashMap

https://issues.apache.org/bugzilla/show_bug.cgi?id=48259

           Summary: Improve StatCalculator performance by using HashMap
           Product: JMeter
           Version: Nightly (Please specify date)
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: andrey.hitrin@gmail.com


Created an attachment (id=24582)
 --> (https://issues.apache.org/bugzilla/attachment.cgi?id=24582)
Use HashMap for keeping values distribution instead of ArrayList

There is no actually need to store *each* value separately in StatCalculator
class. It's enough to save only counter of occurrences for every value. I
propose HashMap class for that instead of ArrayList.

HashMap provides several major benefits:
 - It occupies less memory than ArrayList, especially for large data sets,
because every inserted value will be kept within just one pair (key-value).
 - It has faster data insert (there is no need to call
Collections.binarySearch() for every addValue(), insert into HashMap has O(1)
complexity)
 - It still stays quite fast for reading. It calls for sorting in modified
getPercentPoint() method, but sorts only keys. A number of unique keys is
usually much less than total count of inserted values.

Sorry, I didn't check modified StatCalculator on real data yet, just run JMeter
tests. I will do it after the weekend. But I think it will work fine.

I worked at SVN build 883037.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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


DO NOT REPLY [Bug 48259] Improve StatCalculator performance by using HashMap

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=48259

Sebb <se...@apache.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #1 from Sebb <se...@apache.org> 2009-12-14 16:59:20 UTC ---
Thanks for the patch.

This has been applied to SVN:

URL: http://svn.apache.org/viewvc?rev=890589&view=rev
Log:
Bug 48259 - Improve StatCalculator performance by using HashMap

I made a few changes:
- instead of sorting the keys and using last or first to get max and min the
code keeps track of the values.
- the sorted TreeSet is cached
- use MutableLong (Commons LANG) instead of Long

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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