-
-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
github action to update benchmarks #106
github action to update benchmarks #106
Conversation
node-version: 10 | ||
- name: benchmarks | ||
run: | | ||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is error prone and hard to manage. Put it in a separate file and let it be part of the linter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StarpTech I have removed the inline node code to run the benchmarks, this required a fix to benchmark-bench.js
to avoid the prompts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea is to move the entire code in a file and just run e.g scripts/bench.js
For more realistic benchmark and better isolation I would run each benchmark in a separate ci
https://help.github.com/en/articles/workflow-syntax-for-github-actions#jobs |
If the benchmarks were split into seperate jobs there would be no easy way to get the results of the entire run. |
That's possible but definitly out of scope here. I'm fine 👍 |
benchmark-bench.js
Outdated
filter: Number | ||
} | ||
]) | ||
: (async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
async
is not needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is was that or Promise.resolve. Do you want me to change the inline function to a resolved promise?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If async is an option would you mind to rewrite it to simply use async/await
without ternarys?
2f16052
to
330848b
Compare
@StarpTech I replaced the inline async function with |
node-version: 10 | ||
- name: benchmarks | ||
run: | | ||
npm install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My idea is to move the entire code in a file and just run e.g scripts/bench.js
@StarpTech Splitting the inline script in benchmarks.yml to a seperate file breaks the secrets interpolation stuff (${{ secrets }}) also it won't help with linting as it is a mix of bash and inline node. |
@JamesKyburz I got it. That's my suggestion to the |
16d39be
to
815a4a1
Compare
@StarpTech async/await is now used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
815a4a1
to
c28cca8
Compare
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v1 | ||
- name: Use Node.js ${{ matrix.node-version }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: Use Node.js ${{ matrix.node-version }} | |
- name: Use Node.js 12 |
.github/workflows/benchmarks.yml
Outdated
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 10 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would use the last LTS node
node-version: 10 | |
node-version: 12 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I used 10 because it was the LTS version when the PR was submitted.
updated to use node 12. |
.github/workflows/benchmarks.yml
Outdated
run: | | ||
npm install | ||
npm start y 100 10 40 | ||
npm start y 100 10 40 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are there run twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry that was my interpretation of README.md two rounds; one to warm-up, one to measure
;)
I gather that I should only run them once, and this is taken care of by autocannon
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated the PR
to only run the benchmarks once.
79475c0
to
2713d58
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The secrets Can we merge this? |
I don't have powa here 😅 Kindly ping to @mcollina |
Is I think |
@mcollina Yes that's the correct documentation link. The token has to be created & then added as a secret. The token value is needed to create the git commit message in the github action. |
Is the GitHub Actions default runner environment consistent enough for this task? If we are going to automate benchmark running I would think it'd be desirable that the runner system be consistent between every run. |
@jsumners I am sure that it's a better solution than we currently have and should hopefully be consistent enough. The same virtual hardware is used each time. |
The doc states (at the very beginning):
Why should this created manually? The reason I’m asking is that setting this up will require create a dummy/bot user with write permission to this repo. If possible, I try to minimize yet another account to manage. |
@mcollina I forgot that when I first tested this I read the documentation where it mentioned the github token had read only access in a forked repository (where I was testing from :)) Good news! The default token works, I have just verified the change so we need no extra secrets, so ready for merge :) |
None. |
FYI I noticed that |
Landed, let's see how it goes. |
@mcollina nice! |
@mcollina The github action ran this morning and updated the readme :) |
🎉
Il 1 feb 2020, 14:17 +0100, James Kyburz <[email protected]>, ha scritto:
… @mcollina The github action ran this morning and updated the readme :)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
@@ -56,4 +56,3 @@ yarn.lock | |||
package-lock.json | |||
|
|||
# benchmark results | |||
results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I notice this right now: why we removed from gitignore? I don't find an answer
--:
)CI
without the need for interactive promptsThis
PR
is in response to #104