-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/no-wasm-opt' into moc-inline-wit…
…h-new-meter
- Loading branch information
Showing
15 changed files
with
128 additions
and
164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,15 @@ | ||
APP = collections | ||
include ../*.mk | ||
|
||
.PHONY: all motoko rust build perf | ||
all: build perf | ||
|
||
motoko: | ||
set -e; \ | ||
cd motoko; \ | ||
envsubst < mops.template.toml > mops.toml; \ | ||
mops install; \ | ||
dfx canister create --all; \ | ||
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \ | ||
dfx build; \ | ||
rm mops.toml; \ | ||
cd .. | ||
$(call build_with_mops,motoko) | ||
|
||
rust: | ||
set -e; \ | ||
cd rust; \ | ||
dfx canister create --all; \ | ||
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,rust) | ||
|
||
build: motoko rust | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/perf.sh | ||
$(call perf,collections,perf.sh) |
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 |
---|---|---|
@@ -1,30 +1,15 @@ | ||
APP = crypto | ||
include ../*.mk | ||
|
||
.PHONY: all motoko rust build perf | ||
all: build perf | ||
|
||
motoko: | ||
set -e; \ | ||
cd motoko; \ | ||
envsubst < mops.template.toml > mops.toml; \ | ||
mops install; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
rm mops.toml; \ | ||
cd .. | ||
$(call build_with_mops,motoko) | ||
|
||
rust: | ||
set -e; \ | ||
cd rust; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,rust) | ||
|
||
build: motoko rust | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/perf.sh | ||
$(call perf,crypto,perf.sh) |
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 |
---|---|---|
@@ -1,26 +1,15 @@ | ||
APP = dapps | ||
include ../*.mk | ||
|
||
.PHONY: all motoko rust build perf | ||
all: build perf | ||
|
||
motoko: | ||
cd motoko; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,motoko) | ||
|
||
rust: | ||
cd rust; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,rust) | ||
|
||
build: motoko rust | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/basic_dao.sh; \ | ||
ic-repl ../../$(APP)/nft.sh | ||
$(call perf_two,dapps,basic_dao.sh,nft.sh) |
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 |
---|---|---|
@@ -1,28 +1,15 @@ | ||
APP = heartbeat | ||
include ../*.mk | ||
|
||
.PHONY: all motoko rust build perf | ||
all: build perf | ||
|
||
motoko: | ||
cd motoko; \ | ||
envsubst < mops.template.toml > mops.toml; \ | ||
mops install; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
rm mops.toml; \ | ||
cd .. | ||
$(call build_with_mops,motoko) | ||
|
||
rust: | ||
cd rust; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,rust) | ||
|
||
build: motoko rust | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/perf.sh | ||
$(call perf,heartbeat,perf.sh) |
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 |
---|---|---|
@@ -1,23 +1,10 @@ | ||
APP = motoko | ||
include ../*.mk | ||
|
||
.PHONY: all build perf | ||
all: build perf | ||
|
||
build: | ||
envsubst < mops.template.toml > mops.toml; \ | ||
mops install; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
rm mops.toml; \ | ||
cd .. | ||
$(call build_with_mops,motoko) | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/gc.sh; \ | ||
ic-repl ../../$(APP)/classes.sh | ||
|
||
clean: | ||
rm *.wasm && rm mops.toml | ||
$(call perf_two,motoko,gc.sh,classes.sh) |
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 was deleted.
Oops, something went wrong.
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,54 @@ | ||
{ | ||
"canisters": { | ||
"classes": { | ||
"type": "motoko", | ||
"main": "src/Map.mo" | ||
}, | ||
"default": { | ||
"type": "custom", | ||
"candid": "../../collections/rust/collection.did", | ||
"wasm": "default.wasm", | ||
"build": [ | ||
"sh -c '$(dfx cache show)/moc ../../collections/motoko/src/triemap.mo -o default.wasm --public-metadata candid:service $(mops sources)'" | ||
] | ||
}, | ||
"copying": { | ||
"type": "custom", | ||
"candid": "../../collections/rust/collection.did", | ||
"wasm": "copying.wasm", | ||
"build": [ | ||
"sh -c '$(dfx cache show)/moc ../../collections/motoko/src/triemap.mo -o copying.wasm --public-metadata candid:service $(mops sources) --force-gc --copying-gc'" | ||
] | ||
}, | ||
"compacting": { | ||
"type": "custom", | ||
"candid": "../../collections/rust/collection.did", | ||
"wasm": "compacting.wasm", | ||
"build": [ | ||
"sh -c '$(dfx cache show)/moc ../../collections/motoko/src/triemap.mo -o compacting.wasm --public-metadata candid:service $(mops sources) --force-gc --compacting-gc'" | ||
] | ||
}, | ||
"generational": { | ||
"type": "custom", | ||
"candid": "../../collections/rust/collection.did", | ||
"wasm": "generational.wasm", | ||
"build": [ | ||
"sh -c '$(dfx cache show)/moc ../../collections/motoko/src/triemap.mo -o generational.wasm --public-metadata candid:service $(mops sources) --force-gc --generational-gc'" | ||
] | ||
}, | ||
"incremental": { | ||
"type": "custom", | ||
"candid": "../../collections/rust/collection.did", | ||
"wasm": "incremental.wasm", | ||
"build": [ | ||
"sh -c '$(dfx cache show)/moc ../../collections/motoko/src/triemap.mo -o incremental.wasm --public-metadata candid:service $(mops sources) --force-gc --incremental-gc'" | ||
] | ||
} | ||
}, | ||
"defaults": { | ||
"build": { | ||
"packtool": "mops sources", | ||
"args": "" | ||
} | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
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 |
---|---|---|
@@ -1,26 +1,15 @@ | ||
APP = pub-sub | ||
include ../*.mk | ||
|
||
.PHONY: all motoko rust build perf | ||
all: build perf | ||
|
||
motoko: | ||
cd motoko; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,motoko) | ||
|
||
rust: | ||
cd rust; \ | ||
dfx canister create --all; \ | ||
dfx build; \ | ||
cd .. | ||
$(call build,rust) | ||
|
||
build: motoko rust | ||
|
||
perf: | ||
set -e; \ | ||
mkdir -p ../_out/$(APP); \ | ||
cp README.md ../_out/$(APP); \ | ||
cd ../_out/$(APP); \ | ||
ic-repl ../../$(APP)/motoko/perf.sh; \ | ||
ic-repl ../../$(APP)/rust/perf.sh | ||
$(call perf_two,pub-sub,motoko/perf.sh,rust/perf.sh) |
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,45 @@ | ||
define ic-wasm | ||
echo "No Optimize!" | ||
endef | ||
|
||
define build_with_mops | ||
set -e; \ | ||
cd $(1); \ | ||
envsubst < mops.template.toml > mops.toml; \ | ||
mops install; \ | ||
dfx canister create --all; \ | ||
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \ | ||
dfx build; \ | ||
rm mops.toml; \ | ||
$(call ic-wasm,.dfx/local/canisters/); \ | ||
cd .. | ||
endef | ||
|
||
define build | ||
set -e; \ | ||
cd $(1); \ | ||
dfx canister create --all; \ | ||
dfx ledger fabricate-cycles --t 100 --canister $$(dfx identity get-wallet); \ | ||
dfx build; \ | ||
$(call ic-wasm,.dfx/local/canisters/); \ | ||
cd .. | ||
endef | ||
|
||
define prepare_perf | ||
mkdir -p ../_out/$(1); \ | ||
cp README.md ../_out/$(1); \ | ||
cd ../_out/$(1) | ||
endef | ||
|
||
define perf | ||
set -e; \ | ||
$(call prepare_perf,$(1)); \ | ||
ic-repl ../../$(1)/$(2) | ||
endef | ||
|
||
define perf_two | ||
set -e; \ | ||
$(call prepare_perf,$(1)); \ | ||
ic-repl ../../$(1)/$(2); \ | ||
ic-repl ../../$(1)/$(3) | ||
endef |