From: sturlamolden on
On 9 Sep, 16:57, pdpi <pdpinhe...(a)gmail.com> wrote:

> Raising this to 1 million, rather than 100, nodes in the window, the
> timing difference between your version and NumPy's is tiny (but numpy
> still edges you out, but just barely), but they trounce my naive
> version, being around 7 or 8 times faster the list comprehension I
> suggested.

"Premature optimization is the root of all evil in computer
programming."

Speed is not the issue here.



From: pdpi on
On Sep 9, 7:01 pm, sturlamolden <sturlamol...(a)yahoo.no> wrote:
> On 9 Sep, 16:57, pdpi <pdpinhe...(a)gmail.com> wrote:
>
> > Raising this to 1 million, rather than 100, nodes in the window, the
> > timing difference between your version and NumPy's is tiny (but numpy
> > still edges you out, but just barely), but they trounce my naive
> > version, being around 7 or 8 times faster the list comprehension I
> > suggested.
>
> "Premature optimization is the root of all evil in computer
> programming."
>
> Speed is not the issue here.

Sure it is. And safety. And practicality. And all the other reasons
why people use libraries rather than reinventing the wheel every time
they fire up their editors. Given the OP's question, a snarky "you're
not competent enough to do scientific computing" serves no purpose,
where pointing him to NumPy (and SciPy, I forgot to mention that bit)
serves him much better.