forked from kivikakk/comrak
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
79 additions
and
0 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
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,6 @@ | ||
[submodule "vendor/cmark-gfm"] | ||
path = vendor/cmark-gfm | ||
url = https://github.com/kivikakk/cmark-gfm.git | ||
[submodule "vendor/pulldown-cmark"] | ||
path = vendor/pulldown-cmark | ||
url = https://github.com/raphlinus/pulldown-cmark.git |
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,7 +1,43 @@ | ||
ROOT:=$(shell git rev-parse --show-toplevel) | ||
COMMIT:=$(shell git rev-parse --short HEAD) | ||
MIN_RUNS:=25 | ||
|
||
src/scanners.rs: src/scanners.re | ||
re2rust -W -Werror -i --no-generation-date -o $@ $< | ||
cargo fmt | ||
|
||
bench: | ||
cargo build --release | ||
(cd vendor/cmark-gfm/; make bench PROG=../../target/release/comrak) | ||
|
||
binaries: build-comrak-branch build-comrak-master build-cmark-gfm build-pulldown-cmark | ||
|
||
build-comrak-branch: | ||
cargo build --release | ||
cp ${ROOT}/target/release/comrak ${ROOT}/benches/comrak-${COMMIT} | ||
|
||
build-comrak-master: | ||
git clone https://github.com/kivikakk/comrak.git --depth 1 --single-branch ${ROOT}/vendor/comrak || true | ||
cd ${ROOT}/vendor/comrak && \ | ||
cargo build --release && \ | ||
cp ./target/release/comrak ${ROOT}/benches/comrak-main | ||
|
||
build-cmark-gfm: | ||
cd ${ROOT}/vendor/cmark-gfm && \ | ||
make && \ | ||
cp build/src/cmark-gfm ${ROOT}/benches/cmark-gfm | ||
|
||
build-pulldown-cmark: | ||
cd ${ROOT}/vendor/pulldown-cmark && \ | ||
cargo build --release && \ | ||
cp target/release/pulldown-cmark ${ROOT}/benches/pulldown-cmark | ||
|
||
bench-comrak: build-comrak-branch | ||
git clone https://github.com/progit/progit.git ${ROOT}/vendor/progit || true > /dev/null | ||
cd benches && \ | ||
hyperfine --prepare 'sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' --warmup 3 --min-runs ${MIN_RUNS} -L binary comrak-${COMMIT} './bench.sh ./{binary}' | ||
|
||
bench-all: binaries | ||
git clone https://github.com/progit/progit.git ${ROOT}/vendor/progit || true > /dev/null | ||
cd benches && \ | ||
hyperfine --prepare 'sudo sync; echo 3 | sudo tee /proc/sys/vm/drop_caches' --warmup 3 --min-runs ${MIN_RUNS} -L binary comrak-${COMMIT},comrak-main,pulldown-cmark,cmark-gfm './bench.sh ./{binary}' --export-markdown ${ROOT}/bench-output.md |
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,8 @@ | ||
#! /bin/bash | ||
|
||
PROG=$1 | ||
ROOTDIR=$(git rev-parse --show-toplevel) | ||
|
||
for lang in ar az be ca cs de en eo es es-ni fa fi fr hi hu id it ja ko mk nl no-nb pl pt-br ro ru sr th tr uk vi zh zh-tw; do \ | ||
cat $ROOTDIR/vendor/progit/$lang/*/*.markdown | $PROG > /dev/null | ||
done |
Submodule pulldown-cmark
added at
34c2bb