Entering a very large number

Chris Angelico rosuav at gmail.com
Mon Mar 26 11:31:07 EDT 2018


On Mon, Mar 26, 2018 at 11:46 PM, bartc <bc at freeuk.com> wrote:
> On 26/03/2018 13:30, Richard Damon wrote:
>>
>> On 3/26/18 6:31 AM, bartc wrote:
>
>
>>> The purpose was to establish how such int("...") conversions compare in
>>> overheads with actual arithmetic with the resulting numbers.
>>>
>> Of course if this was done in C with a version that had builtin bignum
>> ints or an aggresive enough optimizer (or a Python that did a similar level
>> of optimizations) this function would just test the speed of starting the
>> program, as it actually does nothing and can be optimized away.
>
>
> Which is a nuisance. /You/ are trying to measure how long it takes to
> perform a task, the compiler is demonstrating how long it takes to /not/
> perform it! So it can be very unhelpful.

Yeah. It's so annoying that compilers work so hard to make your code
fast, when all you want to do is measure exactly how slow it is.
Compiler authors are stupid.

ChrisA



More information about the Python-list mailing list