On Tue, Mar 11, 2003 at 12:18:55PM +1100, Martin Pool wrote: > > I observed that it spends a large fraction of its time in > print_parse_jobid, called from traverse_fn_delete, called from > print_queue_update. This function is I think called O(n**2) times, > because smbd compares every job in the tdb against every job in the > print queue. Parsing the string is not terribly expensive, but doing > it so many times is. > > It would be better to parse the jobids just once, when the lpq output > is read, and store them in the print_queue_struct. I was just trying > to work out the right time to put them in there.
Doh ! Yeah, that's a really good idea. Wish I'd thought of it :-). It would make the stress tests of a certain person in Roseville much harder to destroy Samba :-). Jeremy.