binast / binjs-ref

Reference implementation for the JavaScript Binary AST format

Home Page:https://binast.github.io/binjs-ref/binjs/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Gather statistics on how well suited our probability tables are

Yoric opened this issue · comments

Using #374 on tests/data/facebook/single without a dictionary

Bools

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 100 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Interfaces

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 56 9 0 4 0 0 3 5 0 0 5 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 13

String enums

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 0 46 0 0 7 0 0 0 0 0 45 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

With dictionary

Protocol

$ cargo run --release --bin binjs_generate_prediction_tables --  --in tests/data/facebook/single/*.js --out /tmp/binjs/facebook-reference/dict/

$ cargo run --release --bin binjs_encode -- --show-stats --in tests/data/facebook/single/ --out /tmp/binjs/facebook-reference advanced entropy --dictionary /tmp/binjs/facebook-reference/dict/dict.entropy 

Data

Legend:

  • Bucket 0 = probability between 0 and 1/32
  • Bucket 1 = probability between 1/32 and 2/32
  • ...
  • Bucket 31 = probability between 31/32 and 1.

Bools

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 0 0 0 2 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 1 8 0 0 0 0 12 4 0 68 0

Interface

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 3 3 3 3 4 4 3 4 3 2 3 3 2 2 1 2 2 1 1 1 3 1 1 1 2 3 2 1 1 2 21 13

String enums

bucket 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
% 4 5 4 2 4 4 3 1 3 2 1 1 1 0 0 0 0 0 4 0 1 2 1 1 0 0 1 3 0 2 51 0