File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
stringdtype/stringdtype/src Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -163,6 +163,17 @@ stringdtype_getitem(StringDTypeObject *NPY_UNUSED(descr), char **dataptr)
163
163
return NULL ;
164
164
}
165
165
166
+ /*
167
+ * In principle we should return a StringScalar instance here, but
168
+ * creating a StringScalar via PyObject_CallFunctionObjArgs has
169
+ * approximately 4 times as much overhead than just returning a str
170
+ * here. This is due to Python overhead as well as copying the string
171
+ * buffer from val_obj to the StringScalar we'd like to return. In
172
+ * principle we could avoid this by making a C function like
173
+ * PyUnicode_FromStringAndSize that fills a StringScalar instead of a
174
+ * str. For now (4-11-23) we are punting on that with the expectation that
175
+ * eventually the scalar type for this dtype will be str.
176
+ */
166
177
return val_obj ;
167
178
}
168
179
You can’t perform that action at this time.
0 commit comments