aboutsummaryrefslogtreecommitdiff
path: root/src/offset.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2023-08-16 12:00:29 +0200
committerMartin Fischer <martin@push-f.com>2023-08-19 13:41:55 +0200
commit180f6d6111b966627aa00a4017b6fb9751f7386c (patch)
tree4a0b638eebf352761da3425370ba3ac8dbad73c5 /src/offset.rs
parent78c2066021deda483a4f0a1bb575543d98d27dca (diff)
perf: only store start offsets for attribute spans
This spares us two usizes per AttrInternal<Range<usize>>. So on a 64 bit target where a usize is 8 bytes this spares us 16 bytes of memory per attribute (if spans are enabled, ... for Token<()> this obviously doesn't change anything). And the DefaultEmitter now also no longer has to update the spans on each Emitter::push_attribute_(name|value) call. The spans are now calculated on demand by the Attribute methods, which is fine since the assumption is that API users are only interested in a few specific spans (rather than all spans).
Diffstat (limited to 'src/offset.rs')
0 files changed, 0 insertions, 0 deletions