source: trip-planner-front/node_modules/hpack.js/bin/benchmark@ b738035

Last change on this file since b738035 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 692 bytes
Line 
1#!/usr/bin/env node
2var hpack = require('../');
3
4var options = {
5 table: { size: 1024 }
6};
7
8var compressor = hpack.compressor.create(options);
9
10var vector = [];
11for (var i = 0; i < 1024; i++) {
12 vector.push({
13 name: 'kind-of-big-header-name__',
14 value: 'not-so-small value yes!',
15 huffman: true,
16 neverIndex: true
17 });
18}
19compressor.write(vector);
20var input = compressor.read();
21
22console.time('decompressor');
23for (var i = 0; i < 2000; i++) {
24 var decompressor = hpack.decompressor.create(options);
25
26 decompressor.write(input);
27 decompressor.execute();
28 while (true) {
29 var chunk = decompressor.read();
30 if (!chunk)
31 break;
32 }
33}
34console.timeEnd('decompressor');
Note: See TracBrowser for help on using the repository browser.