8000 fix: 224 action hangs in some cases for go fiber benchmarks by ktrz · Pull Request #225 · benchmark-action/github-action-benchmark · GitHub
[go: up one dir, main page]

Skip to content

Conversation

ktrz
Copy link
Member
@ktrz ktrz commented Feb 1, 2024
  • fix reExtract regexp to avoid catastrophic backtracking
  • add test cases from fiber that were causing issues

fixes #224

* fix reExtract regexp to avoid catastrophic backtracking
* add test cases from fiber that were causing issues
@ktrz ktrz requested a review from ningziwen February 1, 2024 14:25
@ktrz ktrz self-assigned this Feb 1, 2024
@ktrz ktrz mentioned this pull request Feb 1, 2024
…le metrics in Go but they were not extracted properly before v1.18.0
// "The fields are separated by runs of space characters (as defined by unicode.IsSpace), so the line can be parsed with strings.Fields. The line must have an even number of fields, and at least four."
const reExtract =
/^(?<name>Benchmark\w+(?:\/?[\w()$%^&*-=,]*?)*?)(?<procs>-\d+)?\s+(?<times>\d+)\s+(?<remainder>.+)$/;
/^(?<name>Benchmark\w+[\w()$%^&*-=|,[\]{}"#]*?)(?<procs>-\d+)?\s+(?<times>\d+)\s+(?<remainder>.+)$/;
Copy link
Member Author
@ktrz ktrz Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This adds some additional characters that were present in Go Fiber benchmarks as well as removes the nested (()*?)*? which was causing the regex to hang in some instances

value: 40537.456,
extra: '30001 times',
},
{
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the backward compatible metric as before v1.18.0 it was resulting like that in case of multiple metrics

@ktrz ktrz merged commit 1c81dfd into master Feb 2, 2024
@ktrz ktrz deleted the fix/224-action-hangs-on-gofiber-benchmarks branch February 2, 2024 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark job never finishes

2 participants

0