forked from matter-labs/zksync
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the skeleton for the flamegraph target binary
- Loading branch information
Showing
5 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "flamegraph_target" | ||
version = "0.1.0" | ||
edition = "2018" | ||
authors = ["The Matter Labs Team <[email protected]>"] | ||
homepage = "https://zksync.io/" | ||
repository = "https://github.com/matter-labs/zksync" | ||
license = "Apache-2.0" | ||
keywords = ["blockchain", "zksync"] | ||
categories = ["cryptography"] | ||
publish = false # We don't want to publish our tests. | ||
|
||
[dependencies] | ||
zksync_crypto = { path = "../../lib/crypto", version = "1.0" } | ||
structopt = "0.3.20" |
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,22 @@ | ||
# zkSync flamegraph target | ||
|
||
This binary is a playground for analyzing the performance of the zkSync components, using tools | ||
such as [perf] and [cargo-flamegraph]. | ||
|
||
While analyzing the performance of the application overall may be useful, it doesn't really help | ||
when you want to analyze one particular component when it takes ~100% of the runtime, in order to | ||
see weak points clearly. | ||
|
||
[perf]: https://perf.wiki.kernel.org/index.php/Main_Page | ||
[cargo-flamegraph]: https://github.com/flamegraph-rs/flamegraph | ||
|
||
## Design notes | ||
|
||
Since the goal is to avoid *everything* that is not related to the analysis of the particular component, | ||
try to avoid "hidden" runtime logic such as async runtimes (e.g. `tokio::main`) or logging (e.g. `vlog`) | ||
in this crate. If the code you are going to analyze requires `async` support, explicitly create the runtime | ||
for said code only. | ||
|
||
Target code should be written in a manner that stresses component in the most possible way. | ||
If your code needs initialization, separate it from the actual stressing logic, so that in the resulting | ||
flamegraph they will be easily distinguishable. |
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 @@ | ||
fn main() {} |