Skip to content

Commit f573a8e

Browse files
author
Pavel Ivanov
committed
feat: reduce wasm file size and improve Gas and size benchmark compare to NEAR-SDK-RS
1 parent 9623545 commit f573a8e

File tree

21 files changed

+1878
-1674
lines changed

21 files changed

+1878
-1674
lines changed

Diff for: .github/workflows/tests.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
- develop
88
jobs:
99
tests:
10+
timeout-minutes: 30
1011
strategy:
1112
matrix:
1213
platform: [ubuntu-latest, macos-latest]

Diff for: .gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.DS_Store
12
node_modules
23
vendor
34
.idea

Diff for: benchmark/README.md

+269-431
Large diffs are not rendered by default.

Diff for: examples/WASM-FILE-SIZE-COMPARISON.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# NEAR-SDK-JS EXAMPLES
2+
3+
### WASM File Size Comparison Before and After Optimization
4+
5+
| File Name | Before Opt (KB) | After Opt (KB) | % Diff |
6+
| :-------------------------------------- | ------------------: | ------------------: | ------------------: |
7+
| basic-updates-base.wasm | 500.53 | 477.35 | -4.63% |
8+
| basic-updates-update.wasm | 562.14 | 498.71 | -11.27% |
9+
| clean-state.wasm | 496.45 | 473.48 | -4.62% |
10+
| counter-lowlevel.wasm | 472.62 | 468.67 | -0.84% |
11+
| counter-ts.wasm | 496.66 | 473.56 | -4.66% |
12+
| counter.wasm | 496.56 | 473.51 | -4.64% |
13+
| cross-contract-call-loop.wasm | 504.86 | 480.77 | -4.77% |
14+
| cross-contract-call-ts.wasm | 498.54 | 475.04 | -4.71% |
15+
| cross-contract-call.wasm | 498.51 | 475.01 | -4.71% |
16+
| fungible-token-helper.wasm | 495.88 | 472.92 | -4.63% |
17+
| fungible-token-lockable.wasm | 505.26 | 481.73 | -4.66% |
18+
| fungible-token.wasm | 505.12 | 481.39 | -4.69% |
19+
| my-ft.wasm | 520.98 | 495.55 | -4.89% |
20+
| my-nft.wasm | 534.88 | 507.94 | -5.04% |
21+
| nested-collections.wasm | 504.90 | 481.18 | -4.71% |
22+
| nft-approval-receiver.wasm | 504.91 | 480.82 | -4.76% |
23+
| nft-receiver.wasm | 505.10 | 481.05 | -4.76% |
24+
| non-fungible-token-receiver.wasm | 496.51 | 473.51 | -4.63% |
25+
| non-fungible-token.wasm | 503.30 | 479.39 | -4.76% |
26+
| parking-lot.wasm | 500.11 | 476.87 | -4.65% |
27+
| programmatic-update-after.wasm | 496.49 | 473.41 | -4.65% |
28+
| programmatic-update-before.wasm | 496.47 | 473.38 | -4.65% |
29+
| state-migration-new.wasm | 501.13 | 477.72 | -4.67% |
30+
| state-migration-original.wasm | 499.98 | 476.68 | -4.65% |
31+
| status-deserialize-class.wasm | 522.52 | 498.15 | -4.66% |
32+
| status-message-borsh.wasm | 506.13 | 482.19 | -4.73% |
33+
| status-message-collections.wasm | 505.38 | 481.67 | -4.70% |
34+
| status-message-deserialize-err.wasm | 496.05 | 473.03 | -4.64% |
35+
| status-message-migrate-add-field.wasm | 498.11 | 475.02 | -4.64% |
36+
| status-message-serialize-err.wasm | 496.05 | 473.03 | -4.64% |
37+
| status-message.wasm | 496.19 | 473.16 | -4.65% |

Diff for: examples/tsconfig.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
22
"compilerOptions": {
33
"experimentalDecorators": true,
4-
"target": "es2020",
54
"moduleResolution": "node",
5+
"target": "es2020",
6+
"skipLibCheck": true,
67
"noEmit": true
78
},
89
"exclude": ["node_modules"]

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"docs:generate": "typedoc"
1414
},
1515
"devDependencies": {
16-
"turbo": "1.10.16",
16+
"turbo": "1.13.3",
1717
"typedoc": "0.25.4",
1818
"typescript": "4.7.4"
1919
}

Diff for: packages/near-contract-standards/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
"author": "Near Inc <[email protected]>",
1111
"license": "Apache-2.0",
1212
"dependencies": {
13-
"lodash-es": "4.17.21",
1413
"near-sdk-js": "workspace:*"
1514
},
1615
"devDependencies": {

0 commit comments

Comments
 (0)