On 30 syys, 01:24, Shai Berger <[email protected]> wrote:
> > The problem seems to be that on Oracle, 1.1 is NUMERIC, and that is
> > something which _is_ a decimal in Python. We should not change that.
>
> > To me it seems the answer is to use to_binary_float/to_binary_double
> > in raw SQL queries. For example:
>
> But this is an Oracle-specific solution. Exactly the thing I'm trying to 
> avoid.

I just don't like a global flag. You could easily then have some code
that requires numbers as decimals, and some other code that requires
numbers as floats. A global flag is a no-go in this situation.

> > I tested the pull request 393 (the speedup to ._rowfactory). Above
> > test case, and the decimal case runs in around one second, the float
> > case in 0.1 seconds. So, there is a regressions for decimals. On the
> > other hand floats are way faster. Will investigate...
>
> I confirm your findings: Running with different parameters (10,000 rows) I 
> found
> Decimals are ~1.8x slower, floats are ~3 times faster, and significantly, ints
> are ~2 times faster. I suspect in the typical Django application, most numbers
> are ints.
>
> I investigated a little myself, and found the reason to be the redundant
> lookup in _decimal_or_int(): It was referring to Decimal as "decimal.Decimal".
> I moved that to a default argument, and got performance to be ~40% better than
> trunk for decimals too. The pull request is already updated.

This looks very good.

> > As for new features for 1.5: there is roughly a day before feature
> > freeze. Getting any new ticket into 1.5 is really unlikely at this
> > point, existing pull requests have priority.
>
> FWIW, the pull request exists (402).

I walked into this one... But, sorry, I will not have time for this
pull request for 1.5.

 - Anssi

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en.

Reply via email to