On Sep 9, 2008, at 4:36 PM, Jason Merrill wrote: > On Sep 9, 6:35 pm, Justin Walker <[EMAIL PROTECTED]> wrote: >> [snip] >> I can't tell if this is just an artifact of some funky debugging >> interaction (am I debugging the debugger?), or whether this is really >> where the code goes. >> >> Anyone have a clue to spare? Something I'm missing? >> >> Justin > > It looks like the check to see if your expression is none is actually > dominating the run time of this function (see mhansen's response). > First, that suggests that this is a poor candidate for caching. > Premature optimization is the root of all evil, etc.
I get all this, although it's good to see it in print. My real question (not well-posed, I admit) was WTF? Or, in more prosaic language, why is it that the fairly simple question, "is foo == None", takes so long. Given Mike's response, I can expand the question: "why is 'foo is None' so much quicker than 'foo == None'?". Thanks, as always, for your cogent replies. Seriously. Your (JasonM/ s) example is a good one to ponder. Justin -- Justin C. Walker, Curmudgeon at Large Institute for the Absorption of Federal Funds ----------- If it weren't for carbon-14, I wouldn't date at all. ----------- --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---