tame/tamer/benches
Mike Gerwitz 27ba03b59b tamer: xir::escape: Remove XirString in favor of Escaper
This rewrites a good portion of the previous commit.

Rather than explicitly storing whether a given string has been escaped, we
can instead assume that all SymbolIds leaving or entering XIR are unescaped,
because there is no reason for any other part of the system to deal with
such details of XML documents.

Given that, we need only unescape on read and escape on write.  This is
customary, so why didn't I do that to begin with?

The previous commit outlines the reason, mainly being an optimization for
the echo writer that is upcoming.  However, this solution will end up being
better---it's not implemented yet, but we can have a caching layer, such
that the Escaper records a mapping between escaped and unescaped SymbolIds
to avoid work the next time around.  If we share the Escaper between _all_
readers and the writer, the result is that

  1. Duplicate strings between source files and object files (many of which
     are read by both the linker and compiler) avoid re-unescaping; and
  2. Writers can use this cache to avoid re-escaping when we've already seen
     the escaped variant of the string during read.

The alternative would be a global cache, like the internment system, but I
did not find that to be appropriate here, since this is far less
fundamental and is much easier to compose.

DEV-11081
2021-11-12 14:03:23 -05:00
..
asg.rs tamer: {ir::=>}{asg, xir} 2021-11-04 16:13:27 -04:00
asg_lower_xmle.rs tamer: {ir::=>}{asg, xir} 2021-11-04 16:13:27 -04:00
iter.rs tamer: benches/iter.rs: Basic benchmark 2021-10-28 21:17:41 -04:00
memchr.rs tamer: benches (memchr): Add missing bench attr 2021-08-19 23:14:33 -04:00
sym.rs tamer: benches/sym.rs: Interner::intern_utf8 benchmarks 2021-10-19 13:42:26 -04:00
xir.rs tamer: xir::escape: Remove XirString in favor of Escaper 2021-11-12 14:03:23 -05:00