SMARTLIST not very smart for every purpose
routers seem to be stored in a list, which is searched linearly. this is not good for scalability. look what I got:
CPU: P4 / Xeon, speed 2797.2 MHz (estimated) Counted GLOBAL_POWER_EVENTS events (time during which processor is not stopped) with a unit mask of 0x01 (mandatory) count 45000 Counted FSB_DATA_ACTIVITY events (DRDY or DBSY events on the front side bus) with a unit mask of 0x03 (multiple flags) count 45000 Counted BRANCH_RETIRED events (retired branches) with a unit mask of 0x05 (multiple flags) count 45000 Counted BRANCH_RETIRED events (retired branches) with a unit mask of 0x0a (multiple flags) count 45000 samples % samples % samples % samples % symbol name 40310 62.2558 999 64.8280 2186 54.9799 4 12.5000 router_get_by_nickname 4146 6.4032 160 10.3829 611 15.3672 2 6.2500 router_get_combined_status_by_nickname 3811 5.8858 65 4.2180 76 1.9115 2 6.2500 digestmap_get 2771 4.2796 35 2.2713 31 0.7797 1 3.1250 routerlist_assert_ok 2255 3.4827 54 3.5042 471 11.8461 1 3.1250 smartlist_string_isin 1872 2.8912 30 1.9468 47 1.1821 1 3.1250 digestmap_set 1168 1.8039 2 0.1298 26 0.6539 0 0 rijndaelEncrypt
here 85% of CPU time in router_get_by_nickname is spent on this code:
SMARTLIST_FOREACH(routerlist->routers, routerinfo_t *, router, { if (!strcasecmp(router->nickname, nickname)) {
would be nice to have routers in rbtree. no need to sort them all the time, too :)
my tor was pretty idle, I take new profile in 24h and see what's number one then...
it would be fun to simulate for example with 100000 routers and 10000 ExcludeNodes.. how'd I do that? /me wants torbench :)
[Automatically added by flyspray2trac: Operating System: Redhat/CentOS Linux]
Trac:
Username: Safari