Skip to content

New benchmarking using hyperfine#557

Merged
dimitris-m merged 15 commits intomainfrom
dm/bench-hyperfine
Feb 5, 2026
Merged

New benchmarking using hyperfine#557
dimitris-m merged 15 commits intomainfrom
dm/bench-hyperfine

Conversation

@dimitris-m
Copy link
Collaborator

@dimitris-m dimitris-m commented Jan 30, 2026

Changes

Must merge opengrep/semgrep-interfaces#4 first -- this is now DONE.

See perf/opengrep-scripts/README.md for details.

Benchmarking

  • Replace Python bench scripts with shell-based scripts using hyperfine.
  • Add bench.sh, bench-against-sha.sh, compare-outputs.sh, and supporting utilities.
  • New opengrep-diff tool for comparing scan outputs between versions.

Performance improvements

  • Remove unnecessary system calls. In some cases --time was making scans > 2 times slower... now the performance is almost the same.
  • Make --time output more compact and space-efficient. In large repos like grafana the output json with --time was around 20M and now it's around 3M (close to the size without --time).

Small fixes and technical debt

  • Fix Python CLI --time output.
  • Remove unused Common.jsoo (JS target dropped).
  • Remove unused and commented out CLI arguments.
  • Fix opengrep email in cli/setup.py.
  • Add missing opam/parser_vbnet.opam file.

@dimitris-m dimitris-m force-pushed the dm/bench-hyperfine branch 3 times, most recently from 8db6106 to 64b8662 Compare January 30, 2026 03:58
@dimitris-m dimitris-m mentioned this pull request Jan 30, 2026
@dimitris-m dimitris-m force-pushed the dm/bench-hyperfine branch 3 times, most recently from cc5d66b to 1856805 Compare February 4, 2026 00:21
@dimitris-m dimitris-m removed the request for review from willem-delbare February 4, 2026 01:00
When `--time` is passed, we had a lot of system calls to filesize when
in fact the information is already available: we parsed targets and can
calculate `String.length` on the lazy content, which is equivalent.
- We no longer store long sequences of 0s, only rule_id * match_time
entries per file. This applies to json output.

- We estimate more accurately the parsing time (parsing + prefiltering
in fact). This can be further refined but for now it's already an improvement.

In a scan of grafana with the tainting rules from opengrep-rules and the
--time flag, the size of the json dropped from ~20M to ~3M.

NOTE: The ATD of semgrep_interfaces has been adapted.
NOTE: These will be deleted at a later stage.
- added a tool that compares json results so we can track differences
between opengrep versions and between opengrep and semgrep.
- added a set of scripts that can be used to run benchmarks and produce
some useful reports.
New standalone script to generate benchmark reports for all configurations
in a results directory. Supports both multi-config and single-config layouts.
run-benchmarks.sh now calls this after completing benchmarks.
@dimitris-m dimitris-m merged commit 7601289 into main Feb 5, 2026
3 checks passed
@dimitris-m dimitris-m deleted the dm/bench-hyperfine branch February 5, 2026 19:11
@maciejpirog maciejpirog mentioned this pull request Feb 17, 2026
@dimitris-m dimitris-m mentioned this pull request Feb 17, 2026
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Feb 19, 2026
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [opengrep/opengrep](https://github.com/opengrep/opengrep) | patch | `v1.16.0` → `v1.16.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>opengrep/opengrep (opengrep/opengrep)</summary>

### [`v1.16.1`](https://github.com/opengrep/opengrep/releases/tag/v1.16.1): Opengrep 1.16.1

[Compare Source](opengrep/opengrep@v1.16.0...v1.16.1)

#### Improvements

- Pin Nuitka to 2.8.9 across all build workflows by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;594](opengrep/opengrep#594)
- Remove redundant pip and Nuitka dependencies by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;573](opengrep/opengrep#573)
- Support split rule/target directories in test subcommand by [@&#8203;qkaiser](https://github.com/qkaiser) in [#&#8203;576](opengrep/opengrep#576)

#### Benchmarking

- New benchmarking using hyperfine by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;557](opengrep/opengrep#557) and [#&#8203;579](opengrep/opengrep#579)

#### Bug fixes

- Allow multiple logical operators in metavariable comparison by [@&#8203;maciejpirog](https://github.com/maciejpirog) in [#&#8203;590](opengrep/opengrep#590)
- In `--experimental`, don't report git untracked files as skipped with `--use-git-ignore` by [@&#8203;maciejpirog](https://github.com/maciejpirog) in [#&#8203;577](opengrep/opengrep#577)
- C#: Add primary constructor arguments to base class by [@&#8203;maciejpirog](https://github.com/maciejpirog) in [#&#8203;589](opengrep/opengrep#589)
- Dockerfile: Add missing buildkit constructs by [@&#8203;maciejpirog](https://github.com/maciejpirog) in [#&#8203;581](opengrep/opengrep#581)
- Dockerfile: Fix CRLF and comment-in-continuation parsing by [@&#8203;abezdina](https://github.com/abezdina) in [#&#8203;586](opengrep/opengrep#586)
- Rust: Fix taint propagation through variable shadowing by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;572](opengrep/opengrep#572)
- TS/TSX: Add support for the `satisfies` construct by [@&#8203;maciejpirog](https://github.com/maciejpirog) in [#&#8203;592](opengrep/opengrep#592)

#### Installation

- Add Windows install script (pwsh) by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;569](opengrep/opengrep#569)
- Ensure that install.ps1 works on ARM by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;571](opengrep/opengrep#571)
- Fix: handle unparseable cosign version in install.sh by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;580](opengrep/opengrep#580)

#### Documentation

- Improve the README by [@&#8203;dimitris-m](https://github.com/dimitris-m) in [#&#8203;570](opengrep/opengrep#570)

#### New Contributors

- [@&#8203;qkaiser](https://github.com/qkaiser) made their first contribution in [#&#8203;576](opengrep/opengrep#576)
- [@&#8203;abezdina](https://github.com/abezdina) made their first contribution in [#&#8203;586](opengrep/opengrep#586)

**Full Changelog**: <opengrep/opengrep@v1.16.0...v1.16.1>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever MR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNC4yIiwidXBkYXRlZEluVmVyIjoiNDMuMjQuMiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90IiwiYXV0b21hdGlvbjpib3QtYXV0aG9yZWQiLCJkZXBlbmRlbmN5LXR5cGU6OnBhdGNoIl19-->
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.

2 participants