lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yonik Seeley (JIRA)" <>
Subject [jira] Commented: (LUCENE-467) Use Float.floatToRawIntBits over Float.floatToIntBits
Date Thu, 17 Nov 2005 04:27:29 GMT
    [ ] 

Yonik Seeley commented on LUCENE-467:

With -server mode, it's only 3 times as fast, and both are really fairly fast.
I do wonder if the profiler had it's numbers right, or if the act of observation messed things
up... 20% seems too high.

> Use Float.floatToRawIntBits over Float.floatToIntBits
> -----------------------------------------------------
>          Key: LUCENE-467
>          URL:
>      Project: Lucene - Java
>         Type: Improvement
>   Components: Other
>     Versions: 1.9
>     Reporter: Yonik Seeley
>     Priority: Minor

> Copied From my Email:
>   Float.floatToRawIntBits (in Java1.4) gives the raw float bits without
> normalization (like *(int*)&floatvar would in C).  Since it doesn't do
> normalization of NaN values, it's faster (and hopefully optimized to a
> simple inline machine instruction by the JVM).
> On my Pentium4, using floatToRawIntBits is over 5 times as fast as
> floatToIntBits.
> That can really add up in something like Similarity.floatToByte() for
> encoding norms, especially if used as a way to compress an array of
> float during query time as suggested by Doug.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message