Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
path: root/tamer
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@ryansg.com>2020-01-02 23:29:49 -0500
committerMike Gerwitz <mike.gerwitz@ryansg.com>2020-02-24 14:56:28 -0500
commitff0c8bb34fbf2616143205a9fb0848bc783f60a4 (patch)
treec5a2e9b50e30de5212ccee2a20d47a879319e636 /tamer
parent1f4db84f248332a1a891e4d9b7ca28cf3afc547d (diff)
downloadtame-ff0c8bb34fbf2616143205a9fb0848bc783f60a4.tar.gz
tame-ff0c8bb34fbf2616143205a9fb0848bc783f60a4.tar.bz2
tame-ff0c8bb34fbf2616143205a9fb0848bc783f60a4.zip
Order symtable, sym-dep, fragments
This ordering will simplify streaming processing of xmlo files in TAMER. Specifically, we know that symbols will have been declared by the time dependencies are added to the graph (and so we should only be creating edges to existing nodes); and we can halt reading as soon as the closing fragments tag is encountered, avoiding parsing the entirety of these massive XML files. On one particularly large program, this cuts time down from ~0.333s to ~0.300 in the POC linker.
Diffstat (limited to 'tamer')
-rw-r--r--tamer/src/ld/poc.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/tamer/src/ld/poc.rs b/tamer/src/ld/poc.rs
index d7f9733..2cf0100 100644
--- a/tamer/src/ld/poc.rs
+++ b/tamer/src/ld/poc.rs
@@ -314,6 +314,14 @@ fn load_xmlo<'a>(
_ => Ok(()),
}
}
+ Ok(Event::End(ele)) => {
+ match ele.name() {
+ // We don't need to read any further than the end of
+ // the fragments (symtable, sym-deps, fragments)
+ b"preproc:fragments" => break (),
+ _ => Ok(()),
+ }
+ }
Ok(Event::Eof) => break (),
Err(e) => {
panic!("Error at {}: {:?}", reader.buffer_position(), e);