addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupsimageimagesinstagramlinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1outlookpersonJoin Group on CardStartprice-ribbonImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruseryahoo

Re: [python-189] Python performance anti-patterns

From: Brendan
Sent on: Wednesday, January 9, 2013 11:40 AM
I should note that this is just a meetup group, and if you really wanted an answer to this question, you should try the python mailing list, or stackoverflow; though, you might get flamed or downvoted for what some might perceive as an open-ended, loaded question.  

I tend to agree with glyph.  Do an "import this" -- "Readability counts".  In 99.99% of all cases, it makes no sense to obfuscate your code because some esoteric implementation detail of a language feature "might" make it slightly more efficient.  Premature optimization is the root of all evil.


On Mon, Jan 7, 2013 at 8:46 AM, Simeon Franklin <[address removed]> wrote:
Hi all -

I'm wondering if there are any language specific anti-patterns in
Python I should be aware of. I'm not thinking things like choosing the
right algorithm or general observations (don't use an ORM) but
wondering if there are any language level features that may not
perform well.

I can think of legacy issues that are mostly fixed: string
concatenation is now optimized in CPython AFAIK (although I still tend
to join arrays of strings) and there is no need for DSU when
sorting... But for current versions of Python the only things that
jump to mind are observations that hold true for most dynamic
languages: minimize dot lookups, don't overuse objects, etc. Are there
any typical Python gotcha's that I'm missing?

Your feedback is appreciated!

Simeon Franklin

Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
This message was sent by Simeon Franklin ([address removed]) from San Francisco Python Meetup Group.
To learn more about Simeon Franklin, visit his/her member profile:
Set my mailing list to email me

As they are sent

In one daily email

Don't send me mailing list messages
Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Our Sponsors

  • Yelp

    Platinum Sponsor, also a host for majority of our events.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy