ENH: Float64Index now uses Float64Hashtable as a backend
State: closed

closes #6471


Labels:
name: Performance
description: Memory or execution speed performance
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
think we need a vbench so can see perf impact of various operations

getting
slicing
contruction

of fairly long index 

yep i'm in the middle of it now :)

@jreback do u mean slicing/getting with a frame/series or the index itself?

probably both i htink

I think u can test just with the index

iirc that was the issue perf with the object based index was somewhat slow (not sure exactly what was slow - maybe more details on the issue)

actually the op said index ops like

2 \* index were slow
(which if they are object would be true)

it's an odd operation but then again maybe for a float index it's not (though u could simply convert to a series)

maybe give a battery of tests and see what sticks out

just timed that particular operation with a 1,000,000 element float64index ... same speed as raw numpy float64 .... comparing against master ...

i'll add some arith ops in the bench

i don't understand why it says failed .... it's passing on travis ..
https://travis-ci.org/cpcloud/pandas/builds/22912880
maybe i'm being impatient

gr8

for sure will be faster for ops

slicing I suspect might be the same though 

https://travis-ci.org/pydata/pandas

some options thing failed

the green is on the master run not local branch

ah ok ... i'll stop asking questions about travis now, i promise

master:

```
---------------------------------------------------------
Test name                                    |    #0    |
---------------------------------------------------------
index_float64_slice_indexer_even             |   0.0060 |
index_float64_slice_indexer_basic            |   0.0021 |
index_float64_boolean_indexer                |   8.5363 |
index_float64_get                            |   0.0017 |
index_float64_construct                      |  50.8270 |
index_float64_div                            |  32.8536 |
index_float64_mul                            |  31.4170 |
index_float64_boolean_series_indexer         |   8.8483 |
---------------------------------------------------------
Test name                                    |    #0    |
---------------------------------------------------------
```

this PR:

```
---------------------------------------------------------
Test name                                    |    #0    |
---------------------------------------------------------
index_float64_slice_indexer_even             |   0.0060 |
index_float64_slice_indexer_basic            |   0.0017 |
index_float64_boolean_indexer                |   3.5873 |
index_float64_get                            |   0.0020 |
index_float64_construct                      |  37.9570 |
index_float64_div                            |   1.4310 |
index_float64_mul                            |   1.2623 |
index_float64_boolean_series_indexer         |   3.5966 |
---------------------------------------------------------
Test name                                    |    #0    |
---------------------------------------------------------
```

everything's either the same or faster

well a big +1 on that then!

excellent

so maybe add a doc note (in indexing.rst/Float64index section) that as of 0.14 it's now backed by a float index type

otherwise looks good 2 me

@jorisvandenbossche @TomAugspurger 

comments?

@cpcloud I posted to the mailing as well

cool thx!

here's a comparison that's a little easier on the eyes:

```
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
index_float64_mul                            |   1.3734 |  36.9690 |   0.0371 |
index_float64_div                            |   1.4606 |  37.8457 |   0.0386 |
index_float64_boolean_series_indexer         |   4.0197 |  12.3593 |   0.3252 |
index_float64_boolean_indexer                |   3.8797 |  11.3870 |   0.3407 |
index_float64_construct                      |  45.4140 |  64.4014 |   0.7052 |
-------------------------------------------------------------------------------
Test name                                    | head[ms] | base[ms] |  ratio   |
-------------------------------------------------------------------------------
```

This looks great to me -- we have a work around for [xray](https://github.com/akleeman/xray), but it's pretty hacky and this is much nicer. Thanks @cpcloud!

merge when ready

@jreback this was marked for 1.0 i changed to 0.14.0 is that ok?

yep

Great stuff!