Add perf matrix, esp for hybrid
This commit is contained in:
@@ -40,7 +40,8 @@ export default function (sim, forceS, forceF) {
|
||||
initAlready = false,
|
||||
nodes,
|
||||
alreadyRanIterations,
|
||||
hybrid;
|
||||
hybrid,
|
||||
p0 = performance.now(), p1, p2, p3;
|
||||
|
||||
if(simulation != undefined) initSimulation();
|
||||
if(forceS != undefined || forceF != undefined) initForces();
|
||||
@@ -105,14 +106,20 @@ export default function (sim, forceS, forceF) {
|
||||
}
|
||||
|
||||
function fullEnded() {
|
||||
simulation.stop();
|
||||
initAlready = false;
|
||||
simulation.force("Full force", null);
|
||||
event.call("end");
|
||||
}
|
||||
p3 = performance.now();
|
||||
simulation.stop();
|
||||
initAlready = false;
|
||||
simulation.force("Full force", null);
|
||||
console.log("Phase 1 takes", p1-p0);
|
||||
console.log("Phase 2 takes", p2-p1);
|
||||
console.log("Phase 3 takes", p3-p2);
|
||||
console.log("Total", p3-p0);
|
||||
console.log("Phase 3 iterations", alreadyRanIterations);
|
||||
event.call("end");
|
||||
}
|
||||
|
||||
function sampleEnded() {
|
||||
p1 = performance.now();
|
||||
simulation.stop();
|
||||
simulation.force("Sample force", null);
|
||||
// Reset velocity of all nodes
|
||||
@@ -127,6 +134,7 @@ export default function (sim, forceS, forceF) {
|
||||
} else {
|
||||
interpBruteForce(sample, remainder, interpDistanceFn, INTERP_FINE_ITS);
|
||||
}
|
||||
p2 = performance.now();
|
||||
|
||||
event.call("fullTick");
|
||||
alreadyRanIterations = 0;
|
||||
|
||||
@@ -66,6 +66,7 @@ export default function () {
|
||||
if(velocityDiff<stableVelocity){
|
||||
stableVeloHandler();
|
||||
}
|
||||
else console.log(velocityDiff);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user