Skip to content

Commit

Permalink
Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
vipertechofficial committed Jul 27, 2024
1 parent 12d29c2 commit 838ada5
Show file tree
Hide file tree
Showing 62 changed files with 82 additions and 72 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion client/chunk_0.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_1.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_10.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_11.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_12.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_13.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_14.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions client/chunk_15.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_16.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_17.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion client/chunk_18.min.js

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion client/chunk_19.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_2.min.js

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions client/chunk_20.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_21.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_22.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_23.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion client/chunk_24.min.js

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion client/chunk_25.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_26.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_27.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_28.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_29.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_30.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_31.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_32.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_33.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_34.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_35.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_36.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_37.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_38.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/chunk_39.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_4.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_40.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_41.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion client/chunk_42.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_43.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_5.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_6.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion client/chunk_7.min.js

Large diffs are not rendered by default.

File renamed without changes.
3 changes: 1 addition & 2 deletions client/chunk_8.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_9.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_253ae210.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_678f84af.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_690b702c.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_748942c6.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_783709f3.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_7a2a85ee.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_7a2ee6b6.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_8afe242f.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_af9f4ef7.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_main_d939e436.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion client/chunk_norris.min.js

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"buffer-lite": "~2.1.0",
"chromium-base64": "~0.5.0",
"clipboard-polyfill": "~4.0.2",
"core-js": "~3.36.0",
"core-js": "~3.37.1",
"cuint": "~0.2.2",
"events": "~3.3.0",
"flux": "~4.0.3",
Expand All @@ -31,15 +31,15 @@
"howler": "~2.2.3",
"isomorphic-image-size": "~1.0.6",
"javascript-time-ago": "~2.5.9",
"joyson": "~1.0.4",
"joyson": "~1.0.5",
"lottie-web": "~5.12.2",
"node-int64": "~0.4.0",
"os": "~0.1.2",
"pouchdb-adapter-idb": "~8.0.1",
"pouchdb-adapter-memory": "~8.0.1",
"pouchdb-core": "~8.0.1",
"preact": "~10.19.6",
"preact-render-to-string": "~6.3.1",
"pouchdb-adapter-idb": "~9.0.0",
"pouchdb-adapter-memory": "~9.0.0",
"pouchdb-core": "~9.0.0",
"preact": "~10.23.1",
"preact-render-to-string": "~6.5.7",
"process": "~0.11.10",
"raf": "~3.4.1",
"react-colorful": "~5.6.1",
Expand All @@ -48,7 +48,7 @@
"readable-stream": "~4.5.2",
"vtracer-color": "~0.0.5",
"regenerator-runtime": "~0.14.1",
"simdope": "~8.3.0",
"simdope": "~8.5.0",
"snappyjs": "~0.7.0",
"svg64": "~2.0.0",
"svgo": "~2.8.0",
Expand Down
8 changes: 4 additions & 4 deletions service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ var LOAD_FILES_USEFUL = ["/src/fonts/normative/index.css"].concat(["illusion.jpg
var LOAD_FILES_STATIC = ["sfx/md/hero_decorative-celebration-02", "sfx/md/navigation_selection-complete-celebration", "sfx/md/navigation_transition-left", "sfx/md/state-change_confirm-down", "sfx/md/ui_lock", "sfx/md/ui_unlock", "sfx/md/ui_scan", "sfx/md/alert_high-intensity", "sfx/md/navigation_transition-right", "voice/cn/accessing_memory", "voice/cn/complete", "voice/cn/please_wait", "voice/cn/data_upload", "voice/cn/processing", "voice/cn/enhanced", "voice/cn/rewriting_deep_layer_protocols", "voice/cn/vision_activated", "voice/cn/vision_deactivated", "voice/cn/filtering", "music/redeclipse/track_09"].map(F_SND).concat(["presentation", "tutorial", "create", "enhanced", "pixelated", "upload", "share1", "joke1", "create", "enhanced", "pixelated", "presentation", "presentation2", "sponsors", "tutorial", "upload", "labintro", "share2", "share3", "share4", "share5", "share6", "share7", "joke2", "joke3", "joke4", "joke5", "joke6", "joke7", "joke8", "joke9", "joke10", "joke11"].map(F_VID));

// Cache names
var REQUIRED_CACHE = "unless-update-cache-v1073-required";
var USEFUL_CACHE = "unless-update-cache-v1073-useful";
var STATIC_CACHE = "unless-update-cache-v1073-static";
var OTHER_CACHE = "unless-update-cache-v1073-other";
var REQUIRED_CACHE = "unless-update-cache-v1074-required";
var USEFUL_CACHE = "unless-update-cache-v1074-useful";
var STATIC_CACHE = "unless-update-cache-v1074-static";
var OTHER_CACHE = "unless-update-cache-v1074-other";

// Regular expressions for chunk matching
var MAIN_CHILD_CHUNK_REGEX = /chunk_(main_[a-z0-9]+)\.min\.js$/i;
Expand Down
14 changes: 12 additions & 2 deletions src/js/utils/quantimat/QuantiMat.js
Original file line number Diff line number Diff line change
Expand Up @@ -654,9 +654,17 @@ function medianCutQuantize(data, numColors) {
while (boxes.length < numColors) {
let newBoxes = [];
for (let box of boxes) {
if (box.length <= 1) {
newBoxes.push(box);
continue;
}
let { axis, median } = findMedianCut(box);
let [box1, box2] = splitBox(box, axis, median);
newBoxes.push(box1, box2);
if (box1.length > 0 && box2.length > 0) {
newBoxes.push(box1, box2);
} else {
newBoxes.push(box); // Avoid infinite loop by not splitting further
}
}
boxes = newBoxes;
}
Expand Down Expand Up @@ -688,7 +696,8 @@ function findMedianCut(colors) {
});
const axis = ranges.indexOf(Math.max(...ranges));
const sortedColors = colors.slice().sort((a, b) => ((a >> (8 * (2 - axis))) & 0xFF) - ((b >> (8 * (2 - axis))) & 0xFF));
const median = ((sortedColors[sortedColors.length >> 1] >> (8 * (2 - axis))) & 0xFF);
const medianIndex = sortedColors.length >> 1;
const median = ((sortedColors[medianIndex] >> (8 * (2 - axis))) & 0xFF);

return { axis, median };
}
Expand Down Expand Up @@ -723,6 +732,7 @@ function getColorDistance(color1, color2) {
return rDiff * rDiff + gDiff * gDiff + bDiff * bDiff;
}


// Calculate entropy
function calculateEntropy(data) {
const counts = new Int32Array(256);
Expand Down

0 comments on commit 838ada5

Please sign in to comment.