@sentio/runtime 1.40.1-rc.2 → 1.40.2-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,49 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __importDefault = (this && this.__importDefault) || function (mod) {
27
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ const fs_1 = __importDefault(require("fs"));
31
+ const console = __importStar(require("console"));
32
+ const fileContent = fs_1.default.readFileSync('../../../chain/aptos/testdata/block-0-9999.json', { encoding: 'utf-8' });
33
+ // console.log(fileContent)
34
+ const contents = JSON.parse(fileContent);
35
+ console.log(contents.length);
36
+ const raws = [];
37
+ for (const content of contents) {
38
+ raws.push(new TextEncoder().encode(JSON.stringify(content)));
39
+ }
40
+ console.log('test begin');
41
+ const start = Date.now();
42
+ for (let i = 0; i < 10; i++) {
43
+ for (const raw of raws) {
44
+ const x = JSON.parse(new TextDecoder().decode(raw));
45
+ }
46
+ }
47
+ const end = Date.now();
48
+ console.log((end - start) / 1000.0, 'seconds');
49
+ //# sourceMappingURL=decode-benchmark.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decode-benchmark.js","sourceRoot":"","sources":["../src/decode-benchmark.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,4CAAmB;AACnB,iDAAkC;AAElC,MAAM,WAAW,GAAG,YAAE,CAAC,YAAY,CAAC,iDAAiD,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAA;AAC7G,2BAA2B;AAE3B,MAAM,QAAQ,GAAa,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;AAElD,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAE5B,MAAM,IAAI,GAAiB,EAAE,CAAA;AAC7B,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE;IAC9B,IAAI,CAAC,IAAI,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAA;CAC7D;AAED,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;AAEzB,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AAExB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,EAAE;IAC3B,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE;QACtB,MAAM,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;KACpD;CACF;AAED,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;AACtB,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG,MAAM,EAAE,SAAS,CAAC,CAAA","sourcesContent":["#!/usr/bin/env node\n\nimport fs from 'fs'\nimport * as console from 'console'\n\nconst fileContent = fs.readFileSync('../../../chain/aptos/testdata/block-0-9999.json', { encoding: 'utf-8' })\n// console.log(fileContent)\n\nconst contents: object[] = JSON.parse(fileContent)\n\nconsole.log(contents.length)\n\nconst raws: Uint8Array[] = []\nfor (const content of contents) {\n raws.push(new TextEncoder().encode(JSON.stringify(content)))\n}\n\nconsole.log('test begin')\n\nconst start = Date.now()\n\nfor (let i = 0; i < 10; i++) {\n for (const raw of raws) {\n const x = JSON.parse(new TextDecoder().decode(raw))\n }\n}\n\nconst end = Date.now()\nconsole.log((end - start) / 1000.0, 'seconds')\n"]}
package/package.json CHANGED
@@ -1,17 +1,18 @@
1
1
  {
2
2
  "name": "@sentio/runtime",
3
3
  "license": "Apache-2.0",
4
- "version": "1.40.1-rc.2",
4
+ "version": "1.40.2-rc.1",
5
5
  "scripts": {
6
6
  "compile": "tsc -p .",
7
7
  "build": "yarn compile",
8
8
  "build_all": "yarn lerna run --scope=@sentio/runtime build --include-dependencies",
9
9
  "test": "jest",
10
- "run": "ts-node --files src/processor-runner.ts --log-format=json"
10
+ "run": "ts-node --files src/processor-runner.ts --log-format=json",
11
+ "run-benchmark": "ts-node --files src/decode-benchmark.ts"
11
12
  },
12
13
  "dependencies": {
13
14
  "@ethersproject/providers": "~5.7.0",
14
- "@sentio/protos": "^1.40.1-rc.2",
15
+ "@sentio/protos": "^1.40.2-rc.1",
15
16
  "bignumber.js": "^9.1.0",
16
17
  "command-line-args": "^5.2.1",
17
18
  "command-line-usage": "^6.1.3",
@@ -47,5 +48,5 @@
47
48
  "!{lib,src}/tests",
48
49
  "!**/*.test.{js,ts}"
49
50
  ],
50
- "gitHead": "8878c327716e56df804c1894c7f062a2c181c5d6"
51
+ "gitHead": "7c2cee71d649b6ac070f6d3928b45cffc9fc9118"
51
52
  }
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env node
2
+
3
+ import fs from 'fs'
4
+ import * as console from 'console'
5
+
6
+ const fileContent = fs.readFileSync('../../../chain/aptos/testdata/block-0-9999.json', { encoding: 'utf-8' })
7
+ // console.log(fileContent)
8
+
9
+ const contents: object[] = JSON.parse(fileContent)
10
+
11
+ console.log(contents.length)
12
+
13
+ const raws: Uint8Array[] = []
14
+ for (const content of contents) {
15
+ raws.push(new TextEncoder().encode(JSON.stringify(content)))
16
+ }
17
+
18
+ console.log('test begin')
19
+
20
+ const start = Date.now()
21
+
22
+ for (let i = 0; i < 10; i++) {
23
+ for (const raw of raws) {
24
+ const x = JSON.parse(new TextDecoder().decode(raw))
25
+ }
26
+ }
27
+
28
+ const end = Date.now()
29
+ console.log((end - start) / 1000.0, 'seconds')