Fix O(n^2) performance when parsing a big pile of extrainfos

We were doing an O(n) strlen in router_get_extrainfo_hash() for
every one we tried to parse.  Instead, have
router_get_extrainfo_hash() take the length of the extrainfo as an
argument, so that when it's called from
extrainfo_parse_from_string(), it doesn't do a strlen() over the
whole pile of extrainfos.
This commit is contained in:
Nick Mathewson
2012-05-10 17:27:16 -04:00
committed by Roger Dingledine
parent 62f8e3926d
commit 02a650786b
4 changed files with 11 additions and 7 deletions
+3
View File
@@ -0,0 +1,3 @@
o Minor bugfixes (performance):
- Avoid O(n^2) performance characteristics when parsing a large
extrainfo cache. Fixes bug 5828; bugfix on 0.2.0.1-alpha.