Skip to content

Instantly share code, notes, and snippets.

View Yoric's full-sized avatar

David Teller Yoric

View GitHub Profile
@Yoric
Yoric / bitlen.md
Last active September 12, 2019 11:52
Distribution of bit lengths

Unit tests

Max Bit Length Tables (total) Tables (%) Tables with max bit length > this bit length (%)
0 5283 62.50% 37.50%
1 1193 14.11% 23.39%
2 994 11.76% 11.63%
3 491 5.81% 5.82%
4 347 4.11% 1.72%
5 91 1.08% 0.64%
@Yoric
Yoric / Context 0.1 performance.md
Last active September 10, 2019 16:56
Context 0.1 performance

Benchmarking Context 0.1

Baseline

  • strcmp in table read
  • O(entries) lookup in Huffman tables

Unit tests

@Yoric
Yoric / lookup.md
Last active September 6, 2019 14:12
Faster Huffman lookup

We currently use the slowest Huffman lookup ever. Let's fix this :)

Replacing (bits, bitLength) with just a key.

We're currently using a mapping (bits, bitLength) -> value. We can, however, turn this into a mapping paddedBits -> (bitLength, value).

Consider the following Huffman table

Symbol | Binary Code | Int value of Code | Bit Length

@Yoric
Yoric / compression.csv
Created January 29, 2019 17:47
Compressing tests/data/facebook/single/*.js with optimal dictionary: streams
File raw (b) brotli-compressed (b) compression
floats.content 437,222 154,644 35%
identifier_names.content 4,911,852 1,220,574 25%
list_lengths.content 1,985,534 540,598 27%
property_keys.content 2,785,813 1,348,434 48%
string_literals.content 3,100,358 1,494,151 48%
unsigned_longs.content 448,663 90,978 20%
floats.prelude 13,817 10,907 79%
identifier_names.prelude 2,907 1,896 65%
identifier_names_len.prelude 1,012 277 27%
@Yoric
Yoric / compression.md
Created November 15, 2018 16:00
Recent compression numbers

Facebook snapshot:

  • minified, decompressed: 42Mb;
  • minifed, brotli-compressed (max compression): 9Mb;
  • entropy
    • non-optimized dictionary, decompressed: 13Mb;
    • non-optimized dictionary, compressed with brotli: 1.9Mb;
    • minified, entropy-compressed: 6.9Mb

Two notes about the non-optimized dictionary:

@Yoric
Yoric / Errors.log
Created October 1, 2018 09:19
Errors in safe mode (which works)
While registering XPCOM module <static module>, trying to re-register CID '{95790842-75a0-430d-98bf-f5ce3788ea6d}' already registered by <static module>.
Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:2
Error: WebGL warning: getContext: Disallowing antialiased backbuffers due to blacklisting. Troubleshoot.jsm:470:18
Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL is currently disabled. Troubleshoot.jsm:470:18
Error: WebGL warning: getContext: Disallowing antialiased backbuffers due to blacklisting. Troubleshoot.jsm:470:18
Error: WebGL warning: <SetDimensions>: Failed to create WebGL context: WebGL is currently disabled. Troubleshoot.jsm:470:18
NS_ERROR_XPC_GS_RETURNED_FAILURE: Component returned failure code: 0x80570016 (NS_ERROR_XPC_GS_RETURNED_FAILURE) [nsIJSCID.getService]
@Yoric
Yoric / Errors.log
Created October 1, 2018 09:06
Errors without addons
While registering XPCOM module <static module>, trying to re-register CID '{95790842-75a0-430d-98bf-f5ce3788ea6d}' already registered by <static module>.
Bootstrapped manifest not allowed to use 'resource' directive. chrome.manifest:2
OpenGL compositor Initialized Succesfully.
Version: 2.1 ATI-1.68.20
Vendor: ATI Technologies Inc.
Renderer: AMD Radeon Pro 560 OpenGL Engine
FBO Texture Target: TEXTURE_2D
The resource from “https://www.netflix.com/ichnaea/cl2/freeform/WebsiteDetect?source=wwwhead&fetchType=css&modalView=title” was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).[Learn More]
MediaKeySystemAccess::GetKeySystemStatus(com.widevine.alpha) result=available msg=''
Failed to get service worker registration(s): Storage access is restricted in this context due to user settings or private browsing mode. 80002612:103:4
@Yoric
Yoric / Errors.log
Created October 1, 2018 08:59
Error logs
Successfully compiled asm.js code (total compilation time 0ms; not stored in cache (too small to benefit)) adblockplus.js
InvalidStateError: RTCPeerConnection is gone (did you enter Offline mode?) background.js:113
[bug 1345098] Lazy browser prematurely inserted via 'messageManager' property access:
getter@chrome://browser/content/tabbrowser.js:2020:37
getAllFrames@chrome://extensions/content/parent/ext-webNavigation.js:192:15
call/result</<@resource://gre/modules/ExtensionParent.jsm:948:49
withPendingBrowser@resource://gre/modules/ExtensionParent.jsm:602:26
async*call/result<@resource://gre/modules/ExtensionParent.jsm:947:16
withTiming@resource://gre/modules/ExtensionParent.jsm:908:14
interface EagerFunctionDeclaration : Node {
attribute FunctionDeclarationPrologue prologue;
attribute FunctionDeclarationContents data;
};
interface SkippableFunctionDeclaration : Node {
attribute FunctionDeclarationPrologue prologue;
[Skippable] attribute FunctionDeclarationContents data;
};
# Before
-rw-r--r-- 1 dteller wheel 170K May 21 15:02 angular.1.6.5.binjs
-rw-r--r-- 1 dteller wheel 71K May 21 15:02 angular.1.6.5.binjs.gz
-rw-r--r-- 1 dteller wheel 4.7K May 21 15:02 angular.1.6.5.bools
-rw-r--r-- 1 dteller wheel 114B May 21 15:02 angular.1.6.5.bools.gz
-rw-r--r-- 1 dteller wheel 8.7K May 21 15:02 angular.1.6.5.declarations
-rw-r--r-- 1 dteller wheel 2.2K May 21 15:02 angular.1.6.5.declarations.gz
-rw-r--r-- 1 dteller wheel 1.1K May 21 15:02 angular.1.6.5.dict.grammar