-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
set limit as multiple of payload size
- Loading branch information
Showing
8 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import Region "stable-region/Region"; | ||
import Prim "mo:prim"; | ||
|
||
// shows that we can decode up to 15MB of coarse grained data before | ||
// exceeding the candid decoding limit | ||
actor { | ||
|
||
let page : [Nat16] = | ||
Prim.Array_tabulate<Nat16>(65536/4, func i { | ||
Prim.natToNat16(i)}); | ||
|
||
var cnt = 0; | ||
label l while (cnt < 64) { | ||
let a = Prim.Array_tabulate<[Nat16]>(cnt*16, func i {page}); | ||
let b = to_candid (a); | ||
if (b.size() > 10_000_000) break l; | ||
Prim.debugPrint(debug_show {bytes=b.size()}); | ||
let c1 = Prim.performanceCounter(0); | ||
let ?_ = from_candid b : ?[[Nat16]]; | ||
let c2 = Prim.performanceCounter(0); | ||
let diff = c2 - c1; | ||
Prim.debugPrint(debug_show { | ||
bytes = b.size(); | ||
MB = cnt; | ||
instrs = diff; | ||
instr_per_byte = Prim.nat64ToNat diff / b.size() | ||
}); | ||
cnt += 1; | ||
}; | ||
|
||
} | ||
|
||
//SKIP run-low | ||
//SKIP run-ir | ||
//SKIP run | ||
//SKIP ic-ref | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
ingress Completed: Reply: 0x4449444c016c01b3c4b1f204680100010a00000000000000000101 | ||
debug.print: {bytes = 12} | ||
debug.print: {MB = 0; bytes = 12; instr_per_byte = 194; instrs = 2_331} | ||
debug.print: {bytes = 524_348} | ||
debug.print: {MB = 1; bytes = 524_348; instr_per_byte = 86; instrs = 45_447_595} | ||
debug.print: {bytes = 1_048_684} | ||
debug.print: {MB = 2; bytes = 1_048_684; instr_per_byte = 86; instrs = 90_892_859} | ||
debug.print: {bytes = 1_573_020} | ||
debug.print: {MB = 3; bytes = 1_573_020; instr_per_byte = 86; instrs = 136_338_331} | ||
debug.print: {bytes = 2_097_356} | ||
debug.print: {MB = 4; bytes = 2_097_356; instr_per_byte = 86; instrs = 181_783_595} | ||
debug.print: {bytes = 2_621_692} | ||
debug.print: {MB = 5; bytes = 2_621_692; instr_per_byte = 86; instrs = 227_228_859} | ||
debug.print: {bytes = 3_146_028} | ||
debug.print: {MB = 6; bytes = 3_146_028; instr_per_byte = 86; instrs = 272_674_331} | ||
debug.print: {bytes = 3_670_364} | ||
debug.print: {MB = 7; bytes = 3_670_364; instr_per_byte = 86; instrs = 318_119_595} | ||
debug.print: {bytes = 4_194_701} | ||
debug.print: {MB = 8; bytes = 4_194_701; instr_per_byte = 86; instrs = 363_564_898} | ||
debug.print: {bytes = 4_719_037} | ||
debug.print: {MB = 9; bytes = 4_719_037; instr_per_byte = 86; instrs = 409_010_162} | ||
debug.print: {bytes = 5_243_373} | ||
debug.print: {MB = 10; bytes = 5_243_373; instr_per_byte = 86; instrs = 454_455_426} | ||
debug.print: {bytes = 5_767_709} | ||
debug.print: {MB = 11; bytes = 5_767_709; instr_per_byte = 86; instrs = 499_900_898} | ||
debug.print: {bytes = 6_292_045} | ||
debug.print: {MB = 12; bytes = 6_292_045; instr_per_byte = 86; instrs = 545_346_162} | ||
debug.print: {bytes = 6_816_381} | ||
debug.print: {MB = 13; bytes = 6_816_381; instr_per_byte = 86; instrs = 590_791_426} | ||
debug.print: {bytes = 7_340_717} | ||
debug.print: {MB = 14; bytes = 7_340_717; instr_per_byte = 86; instrs = 636_236_690} | ||
debug.print: {bytes = 7_865_053} | ||
debug.print: {MB = 15; bytes = 7_865_053; instr_per_byte = 86; instrs = 681_682_162} | ||
debug.print: {bytes = 8_389_389} | ||
debug.print: {MB = 16; bytes = 8_389_389; instr_per_byte = 86; instrs = 727_127_426} | ||
debug.print: {bytes = 8_913_725} | ||
debug.print: {MB = 17; bytes = 8_913_725; instr_per_byte = 86; instrs = 772_572_690} | ||
debug.print: {bytes = 9_438_061} | ||
debug.print: {MB = 18; bytes = 9_438_061; instr_per_byte = 86; instrs = 818_018_162} | ||
debug.print: {bytes = 9_962_397} | ||
debug.print: {MB = 19; bytes = 9_962_397; instr_per_byte = 86; instrs = 863_463_218} | ||
ingress Completed: Reply: 0x4449444c0000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
idl-limits-fine.mo:19.10-19.12: warning [M0145], this pattern of type | ||
?[[Nat16]] | ||
does not cover value | ||
null | ||
idl-limits-fine.mo:1.8-1.14: warning [M0194], unused identifier Region (delete or rename to wildcard `_` or `_Region`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters