Re: profiling and optimizing

Discussion in 'Python' started by Stefan Behnel, Jul 31, 2012.

  1. Rita, 31.07.2012 14:13:
    > I recently inherented a large python process and everything is lovely. As a
    > learning experience I would like to optimize the code so I ran it thru the
    > profiler
    >
    > python -m cProfile myscript.py
    >
    > It seems majority of the time is taking in the deep copy but that seems to
    > come from a function (or functions) in the code. Is there a way to optimize
    > that? perhaps have a C implementation of the deep copy? Would that
    > be feasible?


    Those approaches would be my second (or maybe even later) step. The first
    one would be to check if the deep copy is really necessary, and if so, if
    it is really necessary to do it over the full depth of the entire object graph.

    Stefan
    Stefan Behnel, Jul 31, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dimitri Ognibene
    Replies:
    0
    Views:
    378
    Dimitri Ognibene
    Apr 25, 2006
  2. Kapil Khosla
    Replies:
    2
    Views:
    309
    Peter van Merkerk
    Jul 18, 2003
  3. Replies:
    1
    Views:
    95
    Mike Austin
    Mar 12, 2006
  4. Chris Angelico

    Re: profiling and optimizing

    Chris Angelico, Jul 31, 2012, in forum: Python
    Replies:
    0
    Views:
    126
    Chris Angelico
    Jul 31, 2012
  5. Peter Otten

    Re: profiling and optimizing

    Peter Otten, Jul 31, 2012, in forum: Python
    Replies:
    0
    Views:
    171
    Peter Otten
    Jul 31, 2012
Loading...

Share This Page