On Thu, Apr 03, 2008 at 09:44:49PM -0700, Dan Price wrote: > Here's my attempt at a performance rewrite. On my AMD64 system I'm > seeing the time it takes to create 100,000 actions drop from about > 7.7secs to about 4.1secs. So we're up to about 25,000 actions/sec.
Awesome. > http://cr.opensolaris.org/~dp/ips-actions/ __init__.py: - line 99: you're no longer using count (well, it looks like it wasn't being used before, either), so you can kill this line. - line 114: I'd had this particular fix in one of my gates for a while, but hadn't seen the need to put it back. I'd use my form of it, though: elif i: nlist += [ i ] - line 133: would it be any better if you didn't have to split here? Perhaps args could be a list of k,v tuples? fromlist() is also used by publish.py, but making that work with a tuple list should be pretty easy. That would also allow you to get rid of the whole saw_error thing. - line 134: Comment doesn't seem to match the code. The common case hopefully isn't an error. - line 138: No need for a continuation backslash inside of parens. But we've been doing "raise Exception, args" in most places, anyway. - line 141: I think "if a not in attrs" is more natural here. - line 145: is using "types.ListType" faster than just using "list" here? - line 146: perhaps "attrs[a].append(v)"? It's probably marginally faster. - line 153: missing conclusion? - line 158: What's changed here? - line 162: kill empty line. Danek _______________________________________________ pkg-discuss mailing list [email protected] http://mail.opensolaris.org/mailman/listinfo/pkg-discuss
