forked from rust-lang/cargo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark resolver. Disabled an optimization.
See orium/rpds#6.
- Loading branch information
Showing
2 changed files
with
82 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
LOOPS=20 | ||
|
||
function median() { | ||
left=$(cut -d' ' -f2 $1 | sort -n | tail -$(($LOOPS/2)) | head -1) | ||
right=$(cut -d' ' -f2 $1 | sort -n | tail -$(($LOOPS/2+1)) | head -1) | ||
|
||
echo $((($left+$right)/2)) | ||
} | ||
|
||
function avg() { | ||
sum=0 | ||
|
||
for v in $(cut -d' ' -f2 $1); do | ||
sum=$(($sum+$v)) | ||
done | ||
|
||
echo $(($sum/$LOOPS)) | ||
} | ||
|
||
|
||
|
||
for i in $(seq 1 $LOOPS); do | ||
echo -n "$i " | ||
|
||
CARGO_PROFILE=1 cargo-master generate-lockfile -v 2>&1 \ | ||
| grep resolve-main-loop | grep -o '[0-9]*' | ||
done | tee cargo-master | ||
|
||
echo "MASTER Median $(median cargo-master)" | ||
echo "MASTER Average $(avg cargo-master)" | ||
|
||
for i in $(seq 1 $LOOPS); do | ||
echo -n "$i " | ||
|
||
CARGO_PROFILE=1 cargo-rpds generate-lockfile -v 2>&1 \ | ||
| grep resolve-main-loop | grep -o '[0-9]*' | ||
done | tee cargo-rpds | ||
|
||
echo "RPDS Median $(median cargo-rpds)" | ||
echo "RPDS Average $(avg cargo-rpds)" | ||
|
||
for i in $(seq 1 $LOOPS); do | ||
echo -n "$i " | ||
|
||
CARGO_PROFILE=1 cargo-rpds-rc generate-lockfile -v 2>&1 \ | ||
| grep resolve-main-loop | grep -o '[0-9]*' | ||
done | tee cargo-rpds-rc | ||
|
||
echo "RPDS-RC Median $(median cargo-rpds-rc)" | ||
echo "RPDS-RC Average $(avg cargo-rpds-rc)" | ||
|
||
# RUST resolve-main-loop | ||
# | ||
# MASTER Median 35 | ||
# MASTER Average 35 | ||
# RPDS Median 32 | ||
# RPDS Average 32 | ||
|
||
# SERVO resolve-main-loop | ||
# | ||
# MASTER Median 1870 | ||
# MASTER Average 2640 | ||
# RPDS Median 1695 | ||
# RPDS Average 2805 | ||
# RPDS-RC Median 1339 | ||
# RPDS-RC Average 3221 |
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