profiling and optimizing

Oscar Benjamin oscar.benjamin at bristol.ac.uk
Tue Jul 31 08:23:19 EDT 2012


On 31 July 2012 13:13, Rita <rmorgan466 at gmail.com> wrote:

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

I think you'll need to provide more information to get an answer to your
question. Why are you copying? What are you copying? Do you need a
deep-copy?

I don't really know what you're doing but my first approach would be to try
and reduce or eliminate the deep copies rather than implement them in c.

Oscar.


>
>
>
>
>
>
> --
> --- Get your facts first, then you can distort them as you please.--
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20120731/95ea5e07/attachment.html>


More information about the Python-list mailing list