GCC 15+ disables `-fjump-tables` by default at `-O0`
Author: jkbz64Created Sep 29, 2026Updated Sep 30, 2026
Labelsperfparser-compilation
AI Policy
- I have read the AI Policy and this issue complies with it.
Problem
Since GCC 15 -fjump-tables is disabled at -O0 which can tank performance of tree-sitter grammars up to 200x which makes running tests take a lot of time, consider explicitly enabling jump tables optimization in #pragma GCC optimize ("O0", "jump-tables").
Steps to reproduce
Generate a grammar on a machine w/ GCC 15 or later and run e.g tree-sitter test, the parsing speed will drop heavily.
Expected behavior
The speed goes back to normal.
Tree-sitter version (tree-sitter --version)
tree-sitter 0.27.0
Operating system/version
Linux 7.1.13-asahi-fairydust aarch64 unknown unknown
Source: tree-sitter/tree-sitter