Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #26304

Re: profiling and optimizing

References <CAOF-KfhcDaakdLFt0ZJqKAaY-6HiCQJmBP0x3jf08ytrWmhgew@mail.gmail.com>
Date 2012-07-31 22:21 +1000
Subject Re: profiling and optimizing
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.2770.1343737272.4697.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Jul 31, 2012 at 10:13 PM, Rita <rmorgan466@gmail.com> wrote:
> 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?

Why is the program deep-copying things? Rather than making deepcopy
faster, consider doing it less.

Normally I would first ask: Does the program even NEED optimization?
Often the answer is no, because it's already fast enough - for
instance, if it spends all its time waiting for the internet, there's
little point reducing its CPU footprint. However, that point is moot
in this instance, since you're doing the profiling/optimization for
education rather than performance :) Have fun with it!

Chris Angelico

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: profiling and optimizing Chris Angelico <rosuav@gmail.com> - 2012-07-31 22:21 +1000

csiph-web