terminal: avoid copying set lookup items

Keep the resident RefCountedSet item behind a pointer while probing. The
previous value copy materialized the complete generic item before checking
its metadata and equality, which is especially costly for terminal styles.

ReleaseFast timings are seven-run median user CPU times.

| Workload | Before | After | Change |
| --- | ---: | ---: | ---: |
| 128 styles, live lookup | 0.80s | 0.74s | -7.5% |
| 4,096 styles, live lookup | 0.92s | 0.87s | -5.4% |
| Alternating SGR stream | 1.21s | 1.20s | -0.8% |
This commit is contained in:
Mitchell Hashimoto
2026-07-11 19:53:19 -07:00
parent c68d27c5fa
commit 498533d663

View File

@@ -560,7 +560,7 @@ pub fn RefCountedSet(
return null;
}
const item = items[id];
const item = &items[id];
// An item with a shorter probe sequence length would never
// end up in the middle of another sequence, since it would