tag:blogger.com,1999:blog-8366702.post8042172436213402406..comments2009-04-25T09:23:27.261+02:00Comments on // comments are lies!: A first test of the Alpha NetworkJohan Lindberghttp://www.blogger.com/profile/13455767001846504270noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-8366702.post-23914638021529786412006-09-26T09:28:00.000+02:002006-09-26T09:28:00.000+02:00Yes, I think so.
In Python's defense though I mus...Yes, I think so.<br /><br />In Python's defense though I must say that type checks are *rare* in Python programs. You'd usually just make sure that the needed attributes/methods are present and do whatever it is that you need to do.<br /><br />I might be able to use metaclasses to add a class attribute that could be checked instead.Johan Lindberghttps://www.blogger.com/profile/13455767001846504270noreply@blogger.comtag:blogger.com,1999:blog-8366702.post-36846927764206832672006-09-26T01:58:00.000+02:002006-09-26T01:58:00.000+02:00It's interesting that it takes longer to check the...It's interesting that it takes longer to check the type than the attributes. could it be the type system of python? In java checking type is very quick, so it's almost nothing. you could do a micro benchmark to see how long it takes to inspect the type of 10 objects 500K times.woolfelhttps://www.blogger.com/profile/13814445471254728002noreply@blogger.comtag:blogger.com,1999:blog-8366702.post-21789854760475871952006-09-25T16:25:00.000+02:002006-09-25T16:25:00.000+02:00Peter, I'm already convinced about the ObjectTypeN...Peter, I'm already convinced about the ObjectTypeNode.<br />I'm just wondering *why* it takes more time to check an object's type than it does to check 4 of it's attribute values. I'm not very worried about it though. It's actually a lot faster than I ever thought it would be but I'll still try to squeeze out more speed if I can...Johan Lindberghttps://www.blogger.com/profile/13455767001846504270noreply@blogger.comtag:blogger.com,1999:blog-8366702.post-16727222425943519142006-09-22T22:52:00.000+02:002006-09-22T22:52:00.000+02:00Here is a tip. divide the total time by the number...Here is a tip. divide the total time by the number of objects to get the assert time per object. that will show the benefit of having objectTypeNode. the other test you can do is write 10 rules for foo object and 100 for bar object. Create 2 rulesets: the first with just 10 rules, the second with 110 rules. Assert the foo objects. The elapsed time to assert each object should be basically the same.woolfelhttps://www.blogger.com/profile/13814445471254728002noreply@blogger.com