Author steven.daprano
Recipients ammar2, eamanu, rhettinger, shawn_berry, steven.daprano
Date 2019-02-13.01:45:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550022306.5.0.0584696050893.issue35980@roundup.psfhosted.org>
In-reply-to
Content
What's "BIF" mean? You use that term multiple times but I have never heard it before.

I'm sorry, I don't understand your code (and don't have time to study it in detail to decipher it). It would help if you factored out your new implementation of choices() into a separate function.

I see that your timing code it not reliable for timing individual function calls. You include your setup code that builds the input to choices() as well as the time it takes to print messages, so we can't really draw any reliable conclusions about the speed of choices() from your timings.

To give an analogy: you start the stopwatch at home. Climb into the shower and wash, get dressed, have breakfast, drive to work, park the car, buy a coffee at the shop next door, go to your office, greet your fellow co-workers, and finally stop the stopwatch. And then you say that the total time measured was the time it took you to drive to work alone.

Finally, I can't actually work out what part of your code is intended as a replacement for the choices() function. You should factor it out into a separate function, then time the two function calls:

    choices(dataset, weights)
    shawn_choices(dataset, weights)

alone (without timing the setup of the datasets, or the I/O, or any other irrelevant costs). You probably should use the timeit module for the actual timing.

As for the versions of Python, 3.6 and older are in "bug fix only" mode, so this will not apply to anything older than 3.7.
History
Date User Action Args
2019-02-13 01:45:06steven.dapranosetrecipients: + steven.daprano, rhettinger, ammar2, eamanu, shawn_berry
2019-02-13 01:45:06steven.dapranosetmessageid: <1550022306.5.0.0584696050893.issue35980@roundup.psfhosted.org>
2019-02-13 01:45:06steven.dapranolinkissue35980 messages
2019-02-13 01:45:06steven.dapranocreate