Re: What about an EXPLICIT naming scheme for built-ins?
From: Andrew Durdin (adurdin_at_gmail.com)
Date: 09/04/04
- Next message: Anne & Lynn Wheeler: "Re: Xah Lee's Unixism"
- Previous message: Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.: "Re: Encoding problems"
- Maybe in reply to: Marco Aschwanden: "What about an EXPLICIT naming scheme for built-ins?"
- Next in thread: Andrew MacIntyre: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 4 Sep 2004 08:53:42 +1000 To: python-list@python.org
On Fri, 3 Sep 2004 12:05:38 -0300, Carlos Ribeiro <carribeiro@gmail.com> wrote:
>
> -- overall responsiveness in applications where sort is frequently
> called. Instead of waiting for the full sort at each sorted() call,
> the running time of the sorting method would be divided between the
> calls to the generator. Interactive and multithreaded applications can
> benefit of this approach
So a generator-based implementation could amortize the cost of sorting
over several calls. Whether this will provide a significant benefit
would depend on the algorithm used; quicksort at least wouldn't
provide much benefit, as you'd still use O(log n) time to do the
partitioning needed to get the first element, while returning
subsequent elements would be quicker. I think that for a multithreaded
app (at least), you'd be better off having a thread that does the
sorting, and pushes the results into a shared Queue as it gets them,
and the main thread pulls them out as they come.
> p.s. I opted to send a copy of this answer to the list, I think it's
> good for the discussion. I hope you don't mind.
Oops -- I'd meant to send my reply to the list, but forgot to change
the default recipient.
- Next message: Anne & Lynn Wheeler: "Re: Xah Lee's Unixism"
- Previous message: Michel Claveau - abstraction méta-galactique non triviale en fuite perpétuelle.: "Re: Encoding problems"
- Maybe in reply to: Marco Aschwanden: "What about an EXPLICIT naming scheme for built-ins?"
- Next in thread: Andrew MacIntyre: "Re: What about an EXPLICIT naming scheme for built-ins?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|