It turns out that the two dimensional vectors were causing big slowdowns
authorChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 21:03:38 +0000 (21:03 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 Feb 2004 21:03:38 +0000 (21:03 +0000)
commit16af11d9622cb0ae678df4e21bdb874261626163
treefd43130fbe0fada277451a39547b0b55fe6707d2
parenta44fb0d3621aa818819a074d54d0e9e88fd51967
It turns out that the two dimensional vectors were causing big slowdowns
in this for programs with lots of types (like the testcase in PR224).
The problem was that the type ID that the outer vector was using was not
very dense (as many types are getting resolved), so the vector is large
and gets reallocated a lot.

Since there are a lot of values in the program (the .ll file is 10M),
each reallocation has to copy the subvectors, which is also quite slow
(this wouldn't be a problem if C++ supported move semantics, but it
doesn't, at least not yet :(

Changing the outer data structure to a map speeds a release build of
llvm-as up from 11.21s to 5.13s on the testcase in PR224.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11244 91177308-0d34-0410-b5e6-96231b3b80d8
lib/AsmParser/llvmAsmParser.y