A very fast circular, growable read-write byte buffer.
Fastparse relies heavily on macro-based inlining to provide good performance: inlining allows for better optimization at each callsite compared to all callsites calling into the same shared function body.
Implementations of the various .rep
/.repX
overloads.
Implementations of the various .rep
/.repX
overloads. The most common
and simple overloads are implemented as macros for performance, while the
more complex/general cases are left as normal methods to avoid code bloat
and allow the use of default/named arguments (which don't work in macros
due to https://github.com/scala/bug/issues/5920).
Even the normal method overloads are manually-specialized to some extent for various sorts of inputs as a best-effort attempt ot minimize branching in the hot paths.
Fastparse relies heavily on macro-based inlining to provide good performance: inlining allows for better optimization at each callsite compared to all callsites calling into the same shared function body. Most of these macros do not do anything fancy and simply inline the body of a plain-old-function, although a handful do some partial evaluation e.g. optimizing the
LiteralStr
andCharIn
macros in cases where the String/Char values are known at compile time.