[Python-ideas] minmax() function returning (minimum, maximum) tuple of a sequence
Tal Einat
taleinat at gmail.com
Thu Oct 14 14:05:25 CEST 2010
On Thu, Oct 14, 2010 at 1:23 PM, Steven D'Aprano wrote:
> On Thu, 14 Oct 2010 08:54:31 am you wrote:
>
>> After some thought, I've found a way to make running several "running
>> calculations" in parallel fast. Speed should be comparable to having
>> used the non-running variants.
>
> Speed "should be" comparable? Are you guessing or have you actually
> timed it?
>
> And surely the point of all this extra coding is to make something run
> *faster*, not "comparable to", the sequential algorithm?
The use-case I'm targeting is when you can't hold all of the data in
memory, and it is relatively "expensive" to generate it, e.g. a large
and complex database query. In this case just running the sequential
functions one at a time requires generating the data several times,
once per function. My goal is to facilitate running several
computations on a single iterator without keeping all of the data in
memory.
In almost all cases this will be slower than having run each of the
sequential functions one at a time, if it were possible to keep all of
the data in memory. The grouping optimization aims to reduce the
overhead.
- Tal Einat
More information about the Python-ideas
mailing list