[Xastir] Please....
Tom Russo
russo at bogodyn.org
Wed Jan 12 18:08:19 EST 2005
On Wed, Jan 12, 2005 at 02:17:21PM -0800, we recorded a bogon-computron collision of the <archer at eskimo.com> flavor, containing:
>
> Two hours of runtime gives me the below. I don't think there's much
> question what's using up the CPU when the weather alerts are flying
> by:
>
> Flat profile:
>
> Each sample counts as 0.01 seconds.
> % cumulative self self total
> time seconds seconds calls Ks/call Ks/call name
> 71.36 1440.17 1440.17 1076801 0.00 0.00 alert_match
Fancy that --- looking over the code it appears to do a linear search through
the list of existing alerts, doing lots of memory operations on each item in
the list to shorten the name, and doing a "does this one match?" operation.
Gotta be a more efficient algorithm than that. At a minimum, perhaps the
shortened title could be saved in the alert structure when the alert is
created or modified, so it doesn't have to go through all those
strrchr/memmove operations every time it's compared to?
--
Tom Russo KM5VY SAR502 DM64ux http://www.swcp.com/~russo/
Tijeras, NM QRPL#1592 K2#398 SOC#236 AHTB#1 http://www.qsl.net/~km5vy/
"When life gives you lemons, find someone with a paper cut."
More information about the Xastir
mailing list