Skip to content

Commit

Permalink
Merge pull request #3327 from jreback/index_perf
Browse files Browse the repository at this point in the history
PERF: fixed int64 indexing perf issue when conversion to int64
  • Loading branch information
jreback committed Apr 12, 2013
2 parents 6e32e25 + 0933ba3 commit df2c21c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 0 additions & 5 deletions pandas/core/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pandas/index.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit df2c21c

Please sign in to comment.