Less GC, no re-declare array across iterations
This commit is contained in:
@@ -19,13 +19,14 @@ import {placeNearToNearestNeighbour} from "./interpCommon";
|
||||
* placement of each interpolated point
|
||||
*/
|
||||
export default function(sampleSet, remainderSet, distanceFn, endingIts) {
|
||||
let sampleSubset = takeSampleFrom(sampleSet, Math.sqrt(sampleSet.length)).sample;
|
||||
let
|
||||
sampleSubset = takeSampleFrom(sampleSet, Math.sqrt(sampleSet.length)).sample,
|
||||
sampleSubsetDistanceCache = [];
|
||||
|
||||
// For each datapoint "node" to be interpolated
|
||||
for (let i = remainderSet.length-1; i>=0; i--) {
|
||||
let
|
||||
node = remainderSet[i],
|
||||
sampleSubsetDistanceCache = [],
|
||||
node = remainderSet[i],,
|
||||
nearestSample, minDist, sample, dist, index;
|
||||
|
||||
// For each datapoint "sample" in the sample set
|
||||
|
||||
Reference in New Issue
Block a user