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

[email protected]
Newsgroups gmane.comp.jakarta.jmeter.devel
Message-ID <[email protected]/bugzilla/>
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: [email protected]
        ReportedBy: [email protected]


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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.