Skip to content

Commit ec5488f

Browse files
vnlitvinovanmyachev
authored andcommitted
PERF: Improve performance of hash sets in read_csv (pandas-dev#25804)
1 parent a3c158d commit ec5488f

File tree

5 files changed

+138
-97
lines changed

5 files changed

+138
-97
lines changed

pandas/_libs/khash.pxd

+11
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ cdef extern from "khash_python.h":
5656

5757
bint kh_exist_str(kh_str_t*, khiter_t) nogil
5858

59+
ctypedef struct kh_str_starts_t:
60+
kh_str_t *table
61+
int starts[256]
62+
63+
kh_str_starts_t* kh_init_str_starts() nogil
64+
khint_t kh_put_str_starts_item(kh_str_starts_t* table, char* key,
65+
int* ret) nogil
66+
khint_t kh_get_str_starts_item(kh_str_starts_t* table, char* key) nogil
67+
void kh_destroy_str_starts(kh_str_starts_t*) nogil
68+
void kh_resize_str_starts(kh_str_starts_t*, khint_t) nogil
69+
5970
ctypedef struct kh_int64_t:
6071
khint_t n_buckets, size, n_occupied, upper_bound
6172
uint32_t *flags

0 commit comments

Comments
 (0)