CARVIEW |
Select Language
HTTP/2 200
date: Wed, 30 Jul 2025 19:26:31 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-repository-download: git clone https://github.com/gorhill/uBlock.git
etag: W/"81a87953c820355e51dac34baf46f71f"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-staging.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=UTqzZfRePk%2FL47A7c3QevsnthXFMdc29rONYFQ%2B4UTkgcqtucTtck2vS2XHalDX1QV2qMki7huFL4N052BVb9obe8hUgMsSIfszFYkTenwtfMGmUJ8rM7PFuA8z3sdsFMdqh7%2Bzzw0DI%2FQc3ra8JOAAnzi6zmrzaCCcpSKWCBN8JwO%2FqUOvo2%2B%2Fa9HA%2F8ZWSdU0wSfMlMUYfa5yBpK0Atg7egzdHJVbAnBdREl2pfPSUgZ26TwHZiSDJCf3evD0n1pWE58o34RKdwQVGz4Ty2A%3D%3D--Gq27oznXB0M%2Fw%2Bxc--%2BDvuFpW6Nwhqaz%2B6N%2BT%2F7A%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.872144764.1753903590; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 19:26:30 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Thu, 30 Jul 2026 19:26:30 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: A60E:1EF05F:5371F:6A05A:688A71E6
Refactor selfie generation into a more flexible persistence mechanism · gorhill/uBlock@ed7e34f · GitHub
Copy file name to clipboardExpand all lines: platform/chromium/vapi-common.js
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit ed7e34f
committed
Refactor selfie generation into a more flexible persistence mechanism
The motivation is to address the higher peak memory usage at launch
time with 3rd-gen HNTrie when a selfie was present.
The selfie generation prior to this change was to collect all
filtering data into a single data structure, and then to serialize
that whole structure at once into storage (using JSON.stringify).
However, HNTrie serialization requires that a large UintArray32 be
converted into a plain JS array, which itslef would be indirectly
converted into a JSON string. This was the main reason why peak
memory usage would be higher at launch from selfie, since the JSON
string would need to be wholly unserialized into JS objects, which
themselves would need to be converted into more specialized data
structures (like that Uint32Array one).
The solution to lower peak memory usage at launch is to refactor
selfie generation to allow a more piecemeal approach: each filtering
component is given the ability to serialize itself rather than to be
forced to be embedded in the master selfie. With this approach, the
HNTrie buffer can now serialize to its own storage by converting the
buffer data directly into a string which can be directly sent to
storage. This avoiding expensive intermediate steps such as
converting into a JS array and then to a JSON string.
As part of the refactoring, there was also opportunistic code
upgrade to ES6 and Promise (eventually all of uBO's code will be
proper ES6).
Additionally, the polyfill to bring getBytesInUse() to Firefox has
been revisited to replace the rather expensive previous
implementation with an implementation with virtually no overhead.1 parent 83a3767 commit ed7e34fCopy full SHA for ed7e34f
File tree
Expand file treeCollapse file tree
14 files changed
+585
-319
lines changedFilter options
- platform/chromium
- src
- js
Expand file treeCollapse file tree
14 files changed
+585
-319
lines changed+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
| 10 | + | |
10 | 11 |
| |
11 | 12 |
| |
12 | 13 |
| |
|
platform/chromium/vapi-common.js
Copy file name to clipboardExpand all lines: platform/chromium/vapi-common.js+4Lines changed: 4 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
30 | 30 |
| |
31 | 31 |
| |
32 | 32 |
| |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 |
| |
34 | 38 |
| |
35 | 39 |
| |
|
+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
5 | 5 |
| |
6 | 6 |
| |
7 | 7 |
| |
| 8 | + | |
8 | 9 |
| |
9 | 10 |
| |
10 | 11 |
| |
|
+89-56Lines changed: 89 additions & 56 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
449 | 449 |
| |
450 | 450 |
| |
451 | 451 |
| |
452 |
| - | |
| 452 | + | |
453 | 453 |
| |
454 | 454 |
| |
455 |
| - | |
456 |
| - | |
457 |
| - | |
458 |
| - | |
459 |
| - | |
460 |
| - | |
461 |
| - | |
462 |
| - | |
463 |
| - | |
464 |
| - | |
465 |
| - | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
466 | 464 |
| |
467 | 465 |
| |
468 | 466 |
| |
469 |
| - | |
470 |
| - | |
471 |
| - | |
| 467 | + | |
472 | 468 |
| |
473 | 469 |
| |
474 | 470 |
| |
| |||
513 | 509 |
| |
514 | 510 |
| |
515 | 511 |
| |
516 |
| - | |
| 512 | + | |
517 | 513 |
| |
518 |
| - | |
519 |
| - | |
520 |
| - | |
| 514 | + | |
521 | 515 |
| |
522 | 516 |
| |
523 | 517 |
| |
| |||
542 | 536 |
| |
543 | 537 |
| |
544 | 538 |
| |
545 |
| - | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
546 | 551 |
| |
547 | 552 |
| |
548 | 553 |
| |
549 | 554 |
| |
550 | 555 |
| |
551 | 556 |
| |
552 | 557 |
| |
553 |
| - | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
554 | 562 |
| |
555 | 563 |
| |
556 | 564 |
| |
557 |
| - | |
558 |
| - | |
559 |
| - | |
560 |
| - | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
561 | 568 |
| |
562 | 569 |
| |
563 | 570 |
| |
| |||
582 | 589 |
| |
583 | 590 |
| |
584 | 591 |
| |
585 |
| - | |
586 |
| - | |
587 |
| - | |
| 592 | + | |
588 | 593 |
| |
589 | 594 |
| |
590 | 595 |
| |
591 |
| - | |
592 |
| - | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
593 | 601 |
| |
594 | 602 |
| |
595 | 603 |
| |
| |||
617 | 625 |
| |
618 | 626 |
| |
619 | 627 |
| |
620 |
| - | |
621 |
| - | |
622 |
| - | |
623 |
| - | |
624 |
| - | |
625 |
| - | |
| 628 | + | |
626 | 629 |
| |
627 | 630 |
| |
628 | 631 |
| |
| |||
642 | 645 |
| |
643 | 646 |
| |
644 | 647 |
| |
645 |
| - | |
646 |
| - | |
| 648 | + | |
| 649 | + | |
647 | 650 |
| |
648 | 651 |
| |
649 | 652 |
| |
650 |
| - | |
| 653 | + | |
651 | 654 |
| |
652 | 655 |
| |
653 | 656 |
| |
| |||
671 | 674 |
| |
672 | 675 |
| |
673 | 676 |
| |
674 |
| - | |
| 677 | + | |
675 | 678 |
| |
676 | 679 |
| |
677 | 680 |
| |
| |||
682 | 685 |
| |
683 | 686 |
| |
684 | 687 |
| |
685 |
| - | |
| 688 | + | |
686 | 689 |
| |
687 | 690 |
| |
688 | 691 |
| |
| |||
711 | 714 |
| |
712 | 715 |
| |
713 | 716 |
| |
| 717 | + | |
| 718 | + | |
714 | 719 |
| |
715 |
| - | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
716 | 724 |
| |
717 | 725 |
| |
718 | 726 |
| |
719 |
| - | |
| 727 | + | |
720 | 728 |
| |
721 | 729 |
| |
722 | 730 |
| |
723 |
| - | |
724 |
| - | |
| 731 | + | |
| 732 | + | |
725 | 733 |
| |
726 | 734 |
| |
727 | 735 |
| |
728 | 736 |
| |
729 | 737 |
| |
730 | 738 |
| |
| 739 | + | |
731 | 740 |
| |
732 | 741 |
| |
733 |
| - | |
734 |
| - | |
| 742 | + | |
| 743 | + | |
735 | 744 |
| |
736 | 745 |
| |
737 | 746 |
| |
| |||
748 | 757 |
| |
749 | 758 |
| |
750 | 759 |
| |
751 |
| - | |
| 760 | + | |
752 | 761 |
| |
753 | 762 |
| |
754 | 763 |
| |
| |||
762 | 771 |
| |
763 | 772 |
| |
764 | 773 |
| |
765 |
| - | |
| 774 | + | |
766 | 775 |
| |
767 | 776 |
| |
768 | 777 |
| |
| |||
780 | 789 |
| |
781 | 790 |
| |
782 | 791 |
| |
| 792 | + | |
| 793 | + | |
783 | 794 |
| |
784 | 795 |
| |
785 | 796 |
| |
786 | 797 |
| |
787 |
| - | |
| 798 | + | |
788 | 799 |
| |
789 | 800 |
| |
790 | 801 |
| |
| |||
852 | 863 |
| |
853 | 864 |
| |
854 | 865 |
| |
855 |
| - | |
856 |
| - | |
857 |
| - | |
858 |
| - | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
859 | 879 |
| |
860 | 880 |
| |
861 | 881 |
| |
| |||
895 | 915 |
| |
896 | 916 |
| |
897 | 917 |
| |
898 |
| - | |
| 918 | + | |
899 | 919 |
| |
900 | 920 |
| |
901 | 921 |
| |
902 | 922 |
| |
903 | 923 |
| |
904 | 924 |
| |
905 | 925 |
| |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
906 | 939 |
| |
907 | 940 |
| |
908 | 941 |
| |
| |||
1013 | 1046 |
| |
1014 | 1047 |
| |
1015 | 1048 |
| |
1016 |
| - | |
| 1049 | + | |
1017 | 1050 |
| |
1018 | 1051 |
| |
1019 | 1052 |
| |
|
+6-8Lines changed: 6 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
| 49 | + | |
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
52 | 53 |
| |
53 | 54 |
| |
54 | 55 |
| |
55 | 56 |
| |
| 57 | + | |
56 | 58 |
| |
57 | 59 |
| |
58 | 60 |
| |
| |||
95 | 97 |
| |
96 | 98 |
| |
97 | 99 |
| |
98 |
| - | |
| 100 | + | |
99 | 101 |
| |
100 | 102 |
| |
101 | 103 |
| |
102 |
| - | |
| 104 | + | |
103 | 105 |
| |
104 |
| - | |
| 106 | + | |
105 | 107 |
| |
106 | 108 |
| |
107 | 109 |
| |
| |||
111 | 113 |
| |
112 | 114 |
| |
113 | 115 |
| |
114 |
| - | |
115 |
| - | |
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
| |||
138 | 138 |
| |
139 | 139 |
| |
140 | 140 |
| |
141 |
| - | |
| 141 | + | |
142 | 142 |
| |
143 | 143 |
| |
144 | 144 |
| |
| |||
161 | 161 |
| |
162 | 162 |
| |
163 | 163 |
| |
164 |
| - | |
165 |
| - | |
166 | 164 |
| |
167 | 165 |
| |
168 | 166 |
| |
|
You can’t perform that action at this time.
0 commit comments