Skip to content

Commit

Permalink
u
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Jun 10, 2024
1 parent 668cda9 commit 71a9e95
Showing 1 changed file with 36 additions and 21 deletions.
57 changes: 36 additions & 21 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,22 @@ jobs:
BINARY_SIZE=$(ls -l ./target/release/transform | awk '{print $5}')
echo "BINARY_SIZE=$BINARY_SIZE" >> $GITHUB_OUTPUT
- name: Fix Permission Loss
run: |
tar -cvf transform.tar ./target/release/transform
tar -cvf transform_all.tar ./target/release/transform_all
- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: transform
path: ./target/release/transform
path: transform.tar

- uses: actions/upload-artifact@v4
with:
if-no-files-found: error
name: transform_all
path: ./target/release/transform_all
path: transform_all.tar

# checkout:
# name: Read repos.json
Expand Down Expand Up @@ -98,9 +103,6 @@ jobs:
# with:
# name: transform_all

# - name: chmod +x transform_all
# run: chmod +x ./transform_all

# - name: Transform
# run: ./transform_all ${{ matrix.transform_directories }}

Expand Down Expand Up @@ -180,8 +182,11 @@ jobs:
- uses: actions/download-artifact@v4
with:
name: transform
path: .

- run: chmod 777 ./transform
- run: ls -lh
- run: tar xf transform.tar
- run: ls -lh
- run: curl https://raw.githubusercontent.com/oxc-project/benchmark-files/main/cal.com.tsx > cal.com.tsx

# - name: Duration
Expand All @@ -190,6 +195,7 @@ jobs:
# FILE="./cal.com.tsx"
# hyperfine -i --warmup 10 --export-json output.json "./transform $FILE"
# DURATION=$(jq '.results[0].mean' output.json)
# echo $DURATION
# echo "DURATION=$DURATION" >> $GITHUB_OUTPUT

- name: Max RSS
Expand All @@ -198,7 +204,7 @@ jobs:
FILE="./cal.com.tsx"
/usr/bin/time -l ./transform $FILE
hyperfine --warmup 10 --show-output \
"/usr/bin/time -l ./target/release/transform $FILE > /dev/null" 2>&1 | \
"/usr/bin/time -l ./transform $FILE" 2>&1 | \
grep "maximum resident set size" | \
awk '{ print $1 }' \
> output
Expand All @@ -208,22 +214,31 @@ jobs:
TOTAL=$(awk '{ total += $1 } END { print total }' output)
COUNT=$(wc -l output | awk '{ print $1 }')
AVERAGE=$(echo "$TOTAL $COUNT" | awk '{printf "%.1f", $1 / $2}')
echo $AVERAGE
echo "RSS=$AVERAGE" >> $GITHUB_OUTPUT
# - name: Cycles Elapsed
# id: cycles
# run: |
# FILE="./cal.com.tsx"
# hyperfine --warmup 10 --show-output \
# "/usr/bin/time -l ./transform $FILE > /dev/null" 2>&1 | \
# grep "cycles elapsed" | \
# awk '{ print $1 }' \
# > output

# TOTAL=$(awk '{ total += $1 } END { print total }' output)
# COUNT=$(wc -l output | awk '{ print $1 }')
# AVERAGE=$(echo "$TOTAL $COUNT" | awk '{printf "%.1f", $1 / $2}')
# echo "CYCLES=$AVERAGE" >> $GITHUB_OUTPUT
- name: Cycles Elapsed
id: cycles
run: |
FILE="./cal.com.tsx"
/usr/bin/time -l ./transform $FILE
hyperfine --warmup 10 --show-output \
"/usr/bin/time -l ./transform $FILE" 2>&1 | \
grep "cycles elapsed" | \
awk '{ print $1 }' \
> output
cat output
TOTAL=$(awk '{ total += $1 } END { print total }' output)
COUNT=$(wc -l output | awk '{ print $1 }')
echo $TOTAL
echo $COUNT
AVERAGE=$(echo "$TOTAL $COUNT" | awk '{printf "%.1f", $1 / $2}')
echo $AVERAGE
echo "CYCLES=$AVERAGE" >> $GITHUB_OUTPUT
# - name: Create Data
# run: |
Expand Down

0 comments on commit 71a9e95

Please sign in to comment.