Commit Graph

4 Commits

Author SHA1 Message Date
Anders Eknert 2b18f03b2b topdown: fix "a", "a" in {"a"} not returning true (#8747)
It's mostly useless, but aren't we all.

Also added benchmarks to make sure I didn't mess anything up. And one or
two tiny but unrelated fixes.

---------

Signed-off-by: Anders Eknert <anders.eknert@apple.com>
Signed-off-by: Stephan Renatus <stephan.renatus@gmail.com>
Co-authored-by: Stephan Renatus <stephan.renatus@gmail.com>
2026-06-26 10:04:30 +02:00
Anders Eknert d3f34a3387 Modernize analyzer fixes (#7965)
Have done this some time in the past, but there was a few
new issues this would highlight now that we're on Go 1.24.

Mostly:
- Use `b.Loop()` in benchmarks
- Use `strings.SplitSeq` where possible
- Remove `omitempty` tag for types that can't be empty

Signed-off-by: Anders Eknert <anders@eknert.com>
2025-10-10 17:51:02 +02:00
Anders Eknert 78a5ca2ab4 Simplify interning (#7714)
Use a single generic entrypoint for obtaining interned
terms regardless of type.

Signed-off-by: Anders Eknert <anders@styra.com>
2025-06-23 11:40:00 +02:00
Anders Eknert 20fe70e321 perf: more interning (#7636)
This PR adds interning of strings representing common integer values,
which greatly speeds up "to string" operations on numbers, and updates
some built-ins commonly used for this to make use of interned values
where possible.

This is "light" version of a previous PR that did this more aggressively,
but also came with more caveats. Importantly, interning of new strings is
now never done at "runtime", but only allowed at init time. The API for
interning is marked experimental and should not relied upon by anyone
who expects a stable API.

Signed-off-by: Anders Eknert <anders@styra.com>
2025-05-28 23:19:31 +02:00