Skip to content

Commit d14de24

Browse files
authored
chore: Add a script to profile performance (#11235)
**Description:** The usage documentation is in the script file.
1 parent 6a9fa49 commit d14de24

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

scripts/profile/instruments.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
##
3+
## Usage:
4+
## ./scripts/profile/instruments.sh <crate> <benchmark> <test_name>
5+
##
6+
## - test_name is optional. If not provided, all tests will be profiled.
7+
##
8+
## Example:
9+
## ./scripts/profile/instruments.sh swc_ecma_parser parser cal
10+
##
11+
12+
set -eu
13+
export RUST_LOG=off
14+
15+
ddt profile instruments cargo -t time -p $1 --bench $2 --profile bench -- --bench ${3:-}

scripts/profile/samply.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env bash
2+
##
3+
## Usage:
4+
## ./scripts/profile/samply.sh <crate> <benchmark> <test_name>
5+
##
6+
## - test_name is optional. If not provided, all tests will be profiled.
7+
##
8+
## Example:
9+
## ./scripts/profile/samply.sh swc_ecma_parser parser cal
10+
##
11+
12+
set -eu
13+
export RUST_LOG=off
14+
15+
ddt profile samply cargo -p $1 --bench $2 --profile bench -- --bench ${3:-}

0 commit comments

Comments
 (0)