Skip to content

Commit

Permalink
Freeze objects to improve performance
Browse files Browse the repository at this point in the history
  • Loading branch information
expitau committed Nov 26, 2024
1 parent 22c57d6 commit 22dac70
Show file tree
Hide file tree
Showing 88 changed files with 131 additions and 91 deletions.
8 changes: 7 additions & 1 deletion tools/reformat.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,15 @@ for (let i = 0; i < recipes.length; i++) {
console.log(Math.floor(i / recipes.length * 100) + "%")
}
let [A, B, C] = recipes[i];
let costA = resolvedObj[A][3]
let costB = resolvedObj[B][3]
resolvedObj[A][4].push([resolvedObj[B][0], resolvedObj[C][0]])
resolvedObj[B][4].push([resolvedObj[A][0], resolvedObj[C][0]])
resolvedObj[C][5].push([resolvedObj[A][0], resolvedObj[B][0]])
if (costA > costB) {
resolvedObj[C][5].push([resolvedObj[B][0], resolvedObj[A][0]])
} else {
resolvedObj[C][5].push([resolvedObj[A][0], resolvedObj[B][0]])
}
}

console.log("Sorting and finalizing (takes 60s)...")
Expand Down
2 changes: 1 addition & 1 deletion web/data/data/dat-1.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-10.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-11.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-12.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-13.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-14.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-15.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-16.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-17.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-18.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-19.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-2.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-20.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-21.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-22.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/data/data/dat-23.json

Large diffs are not rendered by default.

Loading

0 comments on commit 22dac70

Please sign in to comment.