Can you start by having a stable benchmark? Instead of calling random have
a reverse counter to create your list in reverse order. That will at least
get somewhat similar work on both languages (javascript random is
notoriously bad at being random).
Maybe the difference in performance is all from
I've already proposed something like this a looong time ago and guido even
said it is a good idea. I never got around to implementing it. How
difficult would be to port this to CPython? The patch seems very concise
On Wed, Sep 28, 2016 at 8:17 AM, Maciej Fijalkowski
wrote:
> On Tue, Sep 27, 2016
Thanks for the reply!
I don't think a reverse counter is better because TimSort (used in
PyPy?) is able to recognise the pattern [1] and do better than other
kinds of sorts. And almost for a year [2] now, V8 implements random as
XorShift128+ which very good. I also tried different sizes and the
ti
On 03/10/16 10:53, Leonardo Santagada wrote:
> I've already proposed something like this a looong time ago and guido
> even said it is a good idea. I never got around to implementing it. How
> difficult would be to port this to CPython? The patch seems very concise
Ah, cool. Do you have a link to
Hi Tuom,
The problem is the key=... argument to sort, which isn't optimized
well. This kind of code is much faster:
wrapped_data = [(p.x, p) for p in data]
wrapped_data.sort()
data = [it[1] for it in wrapped_data]
We should fix this problem. I've created an issue so it doesn't get
lo
Hello Carl,
thanks a lot for the clarification and for creating the ticket!
On Mon, Oct 3, 2016 at 7:28 PM, Carl Friedrich Bolz wrote:
> Hi Tuom,
>
> The problem is the key=... argument to sort, which isn't optimized
> well. This kind of code is much faster:
>
> wrapped_data = [(p.x, p) for