Bug 50450

Summary: [patch] use System.array copy in jacobi solver as, being native, is more performant.
Product: JMeter - Now in Github Reporter: Dave Brosius <dbrosius>
Component: HTTPAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement    
Priority: P2    
Version: Nightly (Please specify date)   
Target Milestone: ---   
Hardware: PC   
OS: Linux   
Attachments: use System.arraycopy
add arraycopy for second loop

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
Comment 5 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2440