dfinity / motoko

Simple high-level language for writing Internet Computer canisters
Apache License 2.0
511 stars 97 forks source link

Add LinkedUp to tests/perf #1203

Open nomeata opened 4 years ago

nomeata commented 4 years ago

We currently only have reversi as a “real world” performance test. We need to add more. LinkedUp is an obvious choice. Non-trivial part: Coming up with a good representative set of calls. This may require https://github.com/dfinity-lab/motoko/issues/1202

chenyan-dfinity commented 4 years ago

Another simpler example is matrix multiplication, which calls a dot-product canister O(n^2) times. We already have this as an e2e test in SDK: https://github.com/dfinity-lab/sdk/tree/master/e2e/assets/matrix_multiply_mo

nomeata commented 4 years ago

I don’t think that’s a good performance test, as it is not a realistic application. We have lots of tests that do random things in test/run and test/drun. I intentionally do not want to include them in the performance optimization, because I think it is misleading to think that we reduced gas usage by 10% if we have just optimized some microbenchmark, and not “real” code. So test/perf should contain our best approximation of real applications.

(My assumption here is of course that nobody will seriously write or use a matrix multiplication canister. Maybe a library, to be used as part of a bigger application.)