-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: reduce list_proposals instructions (#153)
This PR includes the first set of improvements for the `list_proposals`, notable changes are: - Adds the `SelectionFilter` trait with default implementations for `And` and `Or` logic - Changes some of the indexes to user `cbor` serialization instead `candid` - Instead of loading all proposals to memory, only the set that wll be shown in the limit is loaded, the entire selection works with ids Still to follow in a separate PR: - Improve the performance of the sorting (created_dt, expiration_dt, modification_dt) - Improve the performance of the access control checks - Update the remaining models to use cbor as well As noted by the benchmarks by changing the load of proposals to only ids and some of the common indexes to use cbor the total instructions reduced by `66%`.
- Loading branch information
1 parent
ef0be31
commit 70fd9c6
Showing
48 changed files
with
2,168 additions
and
608 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin", "esbenp.prettier-vscode"] | ||
"recommendations": ["Vue.volar", "esbenp.prettier-vscode"] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,3 +1,3 @@ | ||
build_cmd: cargo build --locked --release --target wasm32-unknown-unknown --features canbench-rs | ||
build_cmd: cargo build --locked --release --target wasm32-unknown-unknown --features canbench | ||
wasm_path: ../../../target/wasm32-unknown-unknown/release/wallet.wasm | ||
results_path: results.yml |
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,20 +1,26 @@ | ||
benches: | ||
batch_insert_100_proposals: | ||
repository_batch_insert_100_proposals: | ||
total: | ||
instructions: 3051795057 | ||
instructions: 3107967048 | ||
heap_increase: 2 | ||
stable_memory_increase: 898 | ||
stable_memory_increase: 1410 | ||
scopes: {} | ||
filter_all_proposals_by_default_filters: | ||
repository_filter_all_proposal_ids_by_default_filters: | ||
total: | ||
instructions: 4690513262 | ||
heap_increase: 10 | ||
instructions: 489667791 | ||
heap_increase: 0 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
list_all_proposals: | ||
repository_list_all_proposals: | ||
total: | ||
instructions: 3308284274 | ||
instructions: 3300020748 | ||
heap_increase: 8 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
service_filter_all_proposals_with_default_filters: | ||
total: | ||
instructions: 336959888 | ||
heap_increase: 0 | ||
stable_memory_increase: 0 | ||
scopes: {} | ||
version: 0.1.1 |
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
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
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
9 changes: 4 additions & 5 deletions
9
canisters/wallet/impl/src/models/indexes/proposal_creation_time_index.rs
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
Oops, something went wrong.