Add debugging printouts to skillpoint computation and overall compute
This commit is contained in:
parent
104930c15b
commit
6ba2383e2f
6 changed files with 20 additions and 9 deletions
|
@ -390,7 +390,12 @@ window.onerror = function(message, source, lineno, colno, error) {
|
||||||
};
|
};
|
||||||
|
|
||||||
(async function() {
|
(async function() {
|
||||||
|
const start = Date.now();
|
||||||
let load_promises = [ load_init(), load_ing_init(), load_tome_init() ];
|
let load_promises = [ load_init(), load_ing_init(), load_tome_init() ];
|
||||||
await Promise.all(load_promises);
|
await Promise.all(load_promises);
|
||||||
|
const codestart = Date.now();
|
||||||
init();
|
init();
|
||||||
|
const end = Date.now();
|
||||||
|
console.log(`builder calculation took ${(end-codestart)/ 1000} seconds.`);
|
||||||
|
console.log(`builder total took ${(end-start)/ 1000} seconds.`);
|
||||||
})();
|
})();
|
||||||
|
|
|
@ -1143,5 +1143,6 @@ function builder_graph_init() {
|
||||||
// this will propagate the update to the `stat_agg_node`, and then to damage calc
|
// this will propagate the update to the `stat_agg_node`, and then to damage calc
|
||||||
|
|
||||||
console.log("Set up graph");
|
console.log("Set up graph");
|
||||||
|
let INPUT_UPDATE = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -174,12 +174,15 @@ class ValueCheckComputeNode extends ComputeNode {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let INPUT_UPDATE = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Schedule a ComputeNode to be updated.
|
* Schedule a ComputeNode to be updated.
|
||||||
*
|
*
|
||||||
* @param node : ComputeNode to schedule an update for.
|
* @param node : ComputeNode to schedule an update for.
|
||||||
*/
|
*/
|
||||||
function calcSchedule(node, timeout) {
|
function calcSchedule(node, timeout) {
|
||||||
|
if (INPUT_UPDATE) {
|
||||||
if (node.update_task !== null) {
|
if (node.update_task !== null) {
|
||||||
clearTimeout(node.update_task);
|
clearTimeout(node.update_task);
|
||||||
}
|
}
|
||||||
|
@ -188,6 +191,7 @@ function calcSchedule(node, timeout) {
|
||||||
node.update();
|
node.update();
|
||||||
node.update_task = null;
|
node.update_task = null;
|
||||||
}, timeout);
|
}, timeout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PrintNode extends ComputeNode {
|
class PrintNode extends ComputeNode {
|
||||||
|
|
|
@ -254,5 +254,4 @@ function init_maps() {
|
||||||
redirectMap.set(item.id, item.remapID);
|
redirectMap.set(item.id, item.remapID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log(itemMap);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -232,5 +232,4 @@ function init_ing_maps() {
|
||||||
recipeList.push(recipe["name"]);
|
recipeList.push(recipe["name"]);
|
||||||
recipeIDMap.set(recipe["id"],recipe["name"]);
|
recipeIDMap.set(recipe["id"],recipe["name"]);
|
||||||
}
|
}
|
||||||
console.log(ingMap);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
function calculate_skillpoints(equipment, weapon) {
|
function calculate_skillpoints(equipment, weapon) {
|
||||||
|
const start = Date.now();
|
||||||
// Calculate equipment equipping order and required skillpoints.
|
// Calculate equipment equipping order and required skillpoints.
|
||||||
// Return value: [equip_order, best_skillpoints, final_skillpoints, best_total];
|
// Return value: [equip_order, best_skillpoints, final_skillpoints, best_total];
|
||||||
let fixed = [];
|
let fixed = [];
|
||||||
|
@ -205,5 +206,7 @@ function calculate_skillpoints(equipment, weapon) {
|
||||||
// best_skillpoints: manually assigned (before any gear)
|
// best_skillpoints: manually assigned (before any gear)
|
||||||
// final_skillpoints: final totals (5 individ)
|
// final_skillpoints: final totals (5 individ)
|
||||||
// best_total: total skillpoints assigned (number)
|
// best_total: total skillpoints assigned (number)
|
||||||
|
const end = Date.now();
|
||||||
|
console.log(`skillpoint calculation took ${(end-start)/ 1000} seconds.`);
|
||||||
return [equip_order, best_skillpoints, final_skillpoints, best_total, best_activeSetCounts];
|
return [equip_order, best_skillpoints, final_skillpoints, best_total, best_activeSetCounts];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue