Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: profiling and optimizing (http://www.velocityreviews.com/forums/t948820-re-profiling-and-optimizing.html)

Peter Otten 07-31-2012 01:23 PM

Re: profiling and optimizing
 
Rita wrote:

> 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?


To give what the other respondents said a different angle: if you replace
the deep with a shallow copy: do your unit tests start to fail?

You don't have any? Add them before you start tinkering with the code ;)




All times are GMT. The time now is 01:17 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57