On Mon, 3 Oct 2005, it was written:
> "leo" <[EMAIL PROTECTED]> writes:
>
>> I come from a java background, where Exceptions are a big Avoid Me, but
>> are the performance implications the same in Python?
>
> Well, you could measure it experimentally pretty easily, but anyway,
> Python exception
leo wrote:
>
> You're absolutely right, in fact the code snippet from my OP was taken
> directly from inspect.currentframe. We're intending on using this in
> production, and I'm trying to gauge what the implications may be.
Use sys._getframe() instead; it doesn't raise an exception.
> Wow, I wa
leo wrote:
>>However, I think the functionality you're asking for is available as
>>inspect.currentframe(), and if the implementation is in "C" it may have a tiny
>>performance advantage over the Python version.
>
>
> You're absolutely right, in fact the code snippet from my OP was taken
> direct
> However, I think the functionality you're asking for is available as
> inspect.currentframe(), and if the implementation is in "C" it may have a tiny
> performance advantage over the Python version.
You're absolutely right, in fact the code snippet from my OP was taken
directly from inspect.curr
On Mon, Oct 03, 2005 at 02:34:40PM -0700, leo wrote:
> I come from a java background, where Exceptions are a big Avoid Me, but
> are the performance implications the same in Python? We're expecting a
> big load on our app (100,000 users/hour) , so we'd like to be as tuned
> as possible.
I don't kn
In article <[EMAIL PROTECTED]>,
"leo" <[EMAIL PROTECTED]> wrote:
> Hello all -
>
> I was wondering about the performance implications of explicitly
> raising exceptions to get information about the current frame.
> Something like what the inspect module does, with:
Python uses exceptions intern
As for performance, you'll need to benchmark it.
However, I think the functionality you're asking for is available as
inspect.currentframe(), and if the implementation is in "C" it may have a tiny
performance advantage over the Python version.
Jeff
pgpENIs7apfaF.pgp
Description: PGP signature
-
"leo" <[EMAIL PROTECTED]> writes:
> I come from a java background, where Exceptions are a big Avoid Me, but
> are the performance implications the same in Python?
Well, you could measure it experimentally pretty easily, but anyway,
Python exceptions are much less expensive than Java exceptions.
-
Hello all -
I was wondering about the performance implications of explicitly
raising exceptions to get information about the current frame.
Something like what the inspect module does, with:
---
def currentframe():
"""Return the frame object for the caller's stack frame."""
try:
r