-
-
Notifications
You must be signed in to change notification settings - Fork 185
Fixed various benchmark issues #935
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2730b7e
Fixed various benchmark issues
lolleko 67870bf
Formatting & Adjusted script path
lolleko 9223d4e
Pass core to the js file
lolleko b187f50
Output markdown directly to CLI instead of creating an actions check
lolleko 1dd620a
Fixed github-script usage
lolleko d909430
Fixed visualizer data passing
lolleko 0fcc50a
Linting :)
lolleko 2b2e81c
Return benchmark info from github-script
lolleko ee71760
Fixed glow flags
lolleko db94cf4
Update name of final step
lolleko 375db09
Update .github/workflows/ci.yml
lolleko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
| module.exports = ({ github, context, core }) => { | ||
| const fs = require("fs"); | ||
|
|
||
| const benchmarkResultPathLua = core.getInput("benchmark-result-path-lua", { required: true }); | ||
| const benchmarkInfoLua = JSON.parse(fs.readFileSync(benchmarkResultPathLua)); | ||
|
|
||
| const benchmarkResultPathJIT = core.getInput("benchmark-result-path-jit", { required: true }); | ||
| const benchmarkInfoJIT = JSON.parse(fs.readFileSync(benchmarkResultPathJIT)); | ||
|
|
||
| // Remove Comparison info to save some bytes | ||
| const benchmarkInfoForVizLua = { old: benchmarkInfoLua.old, new: benchmarkInfoLua.new }; | ||
| const buffer = Buffer.from(JSON.stringify(benchmarkInfoForVizLua)); | ||
|
|
||
| const zlib = require("zlib"); | ||
| const compressed = zlib.deflateSync(buffer); | ||
|
|
||
| const summary = | ||
| `[Open visualizer](https://typescripttolua.github.io/benchviz?d=${compressed.toString("base64")})\n` + | ||
| `### Lua5.3\n${benchmarkInfoLua.comparison.summary}\n### LuaJIT\n${benchmarkInfoJIT.comparison.summary}`; | ||
|
|
||
| return summary; | ||
| }; |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Do we even need markdown as an intermediary encoding here? Would changing Lua to output a regular string with ANSI codes require too much changes?
Uh oh!
There was an error while loading. Please reload this page.
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.
Definitely possible without markdown. But I think the tables would be quite a bit of work. Also terminal color handling is often different across platforms and emulators, I am not sure how much of an issue that is, but that might require some additional work.