Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-04-02 16:18:20 -0400
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-04-06 09:55:54 -0400
commit0868453dab210405d06a1592a09c22fc273c1d99 (patch)
tree42da0987ef4b55a8989fef80614eec78635bc5d6 /tamer/benches
parenta4657580caf17e0fadfffb7d219f35158a8a7a78 (diff)
downloadtame-0868453dab210405d06a1592a09c22fc273c1d99.tar.gz
tame-0868453dab210405d06a1592a09c22fc273c1d99.tar.bz2
tame-0868453dab210405d06a1592a09c22fc273c1d99.zip
[DEV-7086] Proper handling of identifier overrides
This is an awkward system that I'd like to remove at some point. It adds complexity. For the meantime, overrides have been arbitrarily restricted to a single override (no override-override). But it's needed being until we rework maps and can handle the illusion of overrides using the template system.
Diffstat (limited to 'tamer/benches')
-rw-r--r--tamer/benches/asg.rs59
1 files changed, 59 insertions, 0 deletions
diff --git a/tamer/benches/asg.rs b/tamer/benches/asg.rs
index 219d758..f3862c1 100644
--- a/tamer/benches/asg.rs
+++ b/tamer/benches/asg.rs
@@ -461,6 +461,65 @@ mod object {
}
#[bench]
+ fn resolve_1_000_override(bench: &mut Bencher) {
+ let interner = DefaultInterner::new();
+ let sym = interner.intern("sym");
+
+ bench.iter(|| {
+ (0..1000)
+ .map(|_| {
+ Sut::declare(&sym)
+ .resolve(
+ IdentKind::Meta,
+ Source {
+ virtual_: true,
+ ..Default::default()
+ },
+ )
+ .unwrap()
+ .resolve(
+ IdentKind::Meta,
+ Source {
+ override_: true,
+ ..Default::default()
+ },
+ )
+ })
+ .for_each(drop);
+ });
+ }
+
+ // Override encountered before virtual
+ #[bench]
+ fn resolve_1_000_override_virt_after_override(bench: &mut Bencher) {
+ let interner = DefaultInterner::new();
+ let sym = interner.intern("sym");
+
+ bench.iter(|| {
+ (0..1000)
+ .map(|_| {
+ Sut::declare(&sym)
+ .resolve(
+ IdentKind::Meta,
+ Source {
+ override_: true,
+ ..Default::default()
+ },
+ )
+ .unwrap()
+ .resolve(
+ IdentKind::Meta,
+ Source {
+ virtual_: true,
+ ..Default::default()
+ },
+ )
+ })
+ .for_each(drop);
+ });
+ }
+
+ #[bench]
fn set_fragment_1_000_resolved_with_new_str(bench: &mut Bencher) {
let interner = DefaultInterner::new();
let sym = interner.intern("sym");