perf(parser): add #[inline] to trivial modifier methods#20826
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds #[inline] annotations to several small, frequently-called helper methods in oxc_parser’s modifier handling to encourage consistent inlining in hot parsing paths.
Changes:
- Added
#[inline]to trivialModifierconstructors/accessors (new,span). - Added
#[inline]to smallModifiershelpers (empty,new_single,add,contains,kinds). - Added
#[inline]toModifierKind::len.
Merging this PR will not alter performance
Comparing Footnotes
|
92c8d6f to
328e6da
Compare
881a81f to
e6c5fb8
Compare
328e6da to
cee52c3
Compare
Merge activity
|
e6c5fb8 to
45d7efb
Compare
Add `#[inline]` to methods of `Modifier`, `Modifiers`, and `ModifierKinds` which are only a few instructions. Compiler very likely inlines them anyway, but it's good to make sure. Also make `Modifier::new` a const function, because there's no reason not to.
cee52c3 to
c4b3d05
Compare
45d7efb to
055a7ac
Compare
Add `#[inline]` to methods of `Modifier`, `Modifiers`, and `ModifierKinds` which are only a few instructions. Compiler very likely inlines them anyway, but it's good to make sure. Also make `Modifier::new` a const function, because there's no reason not to.
c4b3d05 to
2208114
Compare

Add
#[inline]to methods ofModifier,Modifiers, andModifierKindswhich are only a few instructions. Compiler very likely inlines them anyway, but it's good to make sure.Also make
Modifier::newa const function, because there's no reason not to.