chore: perf diff against latest release

This commit is contained in:
harttle
2021-10-02 22:17:03 +08:00
parent 1689576913
commit 0cb520d2d1
8 changed files with 88 additions and 17 deletions
+16
View File
@@ -0,0 +1,16 @@
#!/usr/bin/bash
VERSION_LATEST=$(cat package.json | grep '"version":' | awk -F'"' '{print $4}')
FILE_LOCAL=dist/liquid.node.cjs.js
FILE_LATEST=dist/liquid.node.cjs.$VERSION_LATEST.js
URL_LATEST=https://unpkg.com/liquidjs@$VERSION_LATEST/dist/liquid.node.cjs.js
if [ ! -f $FILE_LATEST ]; then
curl $URL_LATEST > $FILE_LATEST
fi
if [ ! -f $FILE_LOCAL ]; then
BUNDLES=cjs npm run build:dist
fi
node benchmark/diff.js $FILE_LOCAL $FILE_LATEST