New user's initial thoughts / criticisms of Python

Joshua Landau joshua at landau.ws
Mon Nov 11 20:53:24 EST 2013


On 11 November 2013 22:21, Chris Angelico <rosuav at gmail.com> wrote:
> On Tue, Nov 12, 2013 at 7:50 AM, Joshua Landau <joshua at landau.ws> wrote:
>> The obvious way to me is a binary search:
>
> Which makes an O(log n) search where I have an O(1) lookup. The
> startup cost of denormalization doesn't scale, so when the server
> keeps running for two years or more, it's definitely worth processing
> it that way.

log 4 is tiny so I'd expect constant factors to be far more
significant here. Then you add on the better asymptotic behaviours for
large n, space wise, and the simplicity of implementation. This just
seems like a premature optimisation to me, I guess.

I agree that your way is faster; I just don't see a single case in
which I'd care. I do see several circumstances (large or floating
numbers) in which I'd probably prefer my way.

Feel free to disagree, I'm not really trying to convince you.



More information about the Python-list mailing list