Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
0.9.0
Description
Let's take the following micro-benchmark (in Python):
$ python -m timeit -s "import pyarrow as pa; data = [b'xx' for i in range(10000)]" "pa.array(data, type=pa.binary())" 1000 loops, best of 3: 784 usec per loop
If I replace the Status destructor with a no-op:
~Status() { }
then the benchmark result becomes:
$ python -m timeit -s "import pyarrow as pa; data = [b'xx' for i in range(10000)]" "pa.array(data, type=pa.binary())" 1000 loops, best of 3: 561 usec per loop
This is almost a 30% win. I get similar results on the conversion benchmarks in the benchmark suite.
I'm unsure about the explanation. In the common case, delete _state should be extremely fast, since the state is NULL. Yet, it seems it adds significant overhead. Perhaps because of exception handling?
Attachments
Issue Links
- links to