Stories
Slash Boxes
Comments

SoylentNews is people

posted by n1 on Tuesday May 13 2014, @01:11AM   Printer-friendly
from the it's-dark-in-here dept.

We all know that python is slower than compiled languages like C. But what can you do about it? Jake VanderPlas, director of research in the physical sciences for the university of Washington's eScience institute, digs into python's internals to explain how it works and what program design choices you can make to use python efficiently.

 
This discussion has been archived. No new comments can be posted.
Display Options Threshold/Breakthrough Mark All as Read Mark All as Unread
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
  • (Score: 2) by Angry Jesus on Tuesday May 13 2014, @02:24AM

    by Angry Jesus (182) on Tuesday May 13 2014, @02:24AM (#42493)

    Python gets a lot of serious use though. As I recall, Dropbox is almost 100% python (so much so that they are developing their own JIT [dropbox.com]). Youtube is also mostly python (with ffmpeg for the video processing).

    Starting Score:    1  point
    Karma-Bonus Modifier   +1  

    Total Score:   2  
  • (Score: 4, Informative) by physicsmajor on Tuesday May 13 2014, @03:11AM

    by physicsmajor (1471) on Tuesday May 13 2014, @03:11AM (#42515)

    For good reason.

    The same reasons, in fact, why you don't waste time optimizing an inefficient string processing routine which, when you profile, gets used 0.01% of your runtime. To turn that around: if Python lets your team hack out 80% of your application in 5% of the time, thanks to these features, that is an obvious massive win.

    In my experience (warning: Python dev, I'm biased but also not sugarcoating) this is true. Python results in clearer, easier to maintain code. When I need serious performance there's always Cython or the various methods to hook into lower level libraries, but the remaining >= 80% of the time using Python was a clear and objective win for efficiency and maintainability.

    • (Score: 2) by kaszz on Tuesday May 13 2014, @04:01AM

      by kaszz (4211) on Tuesday May 13 2014, @04:01AM (#42530) Journal

      Dito for Perl. What I really like is the powerful and easy pattern matching capability. One can mix huge binaries with bit operations and laissez faires operands that stretch arithmetic to string matching without boundaries.

      As always if you code to shoot yourself in the foot. The code will deliver your misery.

      • (Score: 2) by Nerdfest on Tuesday May 13 2014, @10:56AM

        by Nerdfest (80) on Tuesday May 13 2014, @10:56AM (#42626)

        Clear, easy to maintain Python code? So, you're the guy.

        • (Score: 2) by Nerdfest on Tuesday May 13 2014, @10:58AM

          by Nerdfest (80) on Tuesday May 13 2014, @10:58AM (#42631)

          Damn, meant perl code. Doh.

  • (Score: 2) by LaminatorX on Tuesday May 13 2014, @04:21AM

    by LaminatorX (14) <laminatorxNO@SPAMgmail.com> on Tuesday May 13 2014, @04:21AM (#42533)

    The raw number crunching is slow, but the things I write in Python are network or disk access bound, not CPU bound. I can imagine a sufficiently large data set where that would shift, but in practice it's never happened.