Bug 50450 - [patch] use System.array copy in jacobi solver as, being native, is more performant.
[patch] use System.array copy in jacobi solver as, being native, is more perf...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
Nightly (Please specify date)
PC Linux
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-12-09 23:53 UTC by Dave Brosius
Modified: 2010-12-14 15:48 UTC (History)
0 users



Attachments
use System.arraycopy (782 bytes, patch)
2010-12-09 23:54 UTC, Dave Brosius
Details | Diff
add arraycopy for second loop (1.01 KB, patch)
2010-12-10 07:52 UTC, Dave Brosius
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Brosius 2010-12-09 23:53:35 UTC
Spline3.java
Comment 1 Dave Brosius 2010-12-09 23:54:37 UTC
Created attachment 26390 [details]
use System.arraycopy

rather than manual copying.
Comment 2 Sebb 2010-12-10 07:22:35 UTC
Can't one do the same to the first loop entry? i.e:

      newX[i] = _B[i];

As far as I can tell, it does not matter if newX is overwritten before starting the loop.

Likewise at the end, there is another copy loop:

        for (i = 0; i < _n; i++) {
            _rS[i + 1] = newX[i];
        }

which might benefit from System.arraycopy.

If FindBugs did not find the last one, then perhaps it needs tweaking ;-)
The second one is perhaps harder (but even better if Findbugs can find it).
Comment 3 Dave Brosius 2010-12-10 07:52:56 UTC
Created attachment 26391 [details]
add arraycopy for second loop

converting newX[i] = _B[i]; to a arraycopy probably is counter productive given that the loop is used for other things as well, but the third one is certainly valid.
Comment 4 Sebb 2010-12-14 15:48:58 UTC
Thanks, applied - except I had to change _rs => _rS in the second part of the patch.

URL: http://svn.apache.org/viewvc?rev=1049262&view=rev
Log:
Bug 50450 - use System.array copy in jacobi solver as, being native, is more performant.

Modified:
   jakarta/jmeter/trunk/src/components/org/apache/jmeter/visualizers/Spline3.java
   jakarta/jmeter/trunk/xdocs/changes.xml