From 0933ba396ad10ca19d662f94548545eaaf6c113d Mon Sep 17 00:00:00 2001 From: jreback Date: Fri, 12 Apr 2013 09:26:45 -0400 Subject: [PATCH] PERF: fixed int64 indexing perf issue when conversion to int64 --- pandas/core/index.py | 5 ----- pandas/index.pyx | 3 +++ 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pandas/core/index.py b/pandas/core/index.py index c30b5dca3a28a..57222d6a04c2f 100644 --- a/pandas/core/index.py +++ b/pandas/core/index.py @@ -1332,11 +1332,6 @@ def inferred_type(self): def _constructor(self): return Int64Index - @cache_readonly - def _engine(self): - # property, for now, slow to look up - return self._engine_type(lambda: com._ensure_int64(self.values), len(self)) - @property def asi8(self): # do not cache or you'll create a memory leak diff --git a/pandas/index.pyx b/pandas/index.pyx index c13f1f506f5ed..2ad5474549ec6 100644 --- a/pandas/index.pyx +++ b/pandas/index.pyx @@ -272,6 +272,9 @@ cdef class IndexEngine: cdef class Int64Engine(IndexEngine): + cdef _get_index_values(self): + return algos.ensure_int64(self.vgetter()) + cdef _make_hash_table(self, n): return _hash.Int64HashTable(n)