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-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1linklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

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

From: Matt B.
Sent on: Wednesday, January 9, 2013 12:57 PM
As in any language - write your code clearly and use the correct data
structures.  Then profile - amazed how many people overlook this step and just
start guessing where the bottleneck is...  From the profile data you optimize
the hottest code paths and in Python it's fairly straightforward to move bits
and pieces into C if they're cpu-bound --  if you're I/O bound, libraries like
gevent can help you exploit I/O parallelism.


On Mon, Jan 07, 2013 at 11:48:05AM -0500, Simeon Franklin 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!
> -regards
> Simeon Franklin
> --
> Please Note: If you hit "REPLY", your message will be sent to everyone on this mailing list ([address removed])
> http://www.meetup...­
> 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: http://www.meetup...­
> Set my mailing list to email me
> As they are sent
> http://www.meetup...­
> In one daily email
> http://www.meetup...­
> Don't send me mailing list messages
> http://www.meetup...­
> Meetup, PO Box 4668 #37895 New York, New York[masked] | [address removed]

Matt Billenstein
[address removed]

Our Sponsors

  • Yelp

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

  • Sentry

    Sponsoring the venue, food, and drinks for Open Source Sprint weekend

  • Google Launchpad Space

    Sponsoring the venue, food, and drinks for Project Night in April

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