You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/03/22 22:03:49 UTC
[GitHub] [arrow] westonpace commented on pull request #12695: [C++] It is more expensive than expected to create a default Result
westonpace commented on pull request #12695:
URL: https://github.com/apache/arrow/pull/12695#issuecomment-1075686866
I created this in draft because the solution I feel like the prototyped solution could be improved. It adds an extra branch check to move/copy and feels a bit clunky.
Benchmark results before:
```
-------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------
BM_DefaultStatus 0.208 ns 0.208 ns 1000000000
BM_DefaultResult<int> 347 ns 347 ns 2021402
BM_DefaultResult<Pod> 338 ns 338 ns 2093503
BM_DefaultResult<NonPod> 337 ns 337 ns 2068186
BM_ValuedResultInt 0.205 ns 0.205 ns 1000000000
BM_ValuedResultPod 0.207 ns 0.207 ns 1000000000
BM_ValuedResultNonPod 0.205 ns 0.205 ns 1000000000
BM_InvalidStatus 253 ns 253 ns 2756148
BM_InvalidResult 274 ns 274 ns 2538777
```
And after:
```
-------------------------------------------------------------------
Benchmark Time CPU Iterations
-------------------------------------------------------------------
BM_DefaultStatus 0.207 ns 0.207 ns 1000000000
BM_DefaultResult<int> 1.63 ns 1.63 ns 424630367
BM_DefaultResult<Pod> 1.62 ns 1.62 ns 423489875
BM_DefaultResult<NonPod> 1.64 ns 1.64 ns 418183380
BM_ValuedResultInt 0.206 ns 0.206 ns 1000000000
BM_ValuedResultPod 0.205 ns 0.205 ns 1000000000
BM_ValuedResultNonPod 0.205 ns 0.205 ns 1000000000
BM_InvalidStatus 265 ns 265 ns 2619401
BM_InvalidResult 286 ns 286 ns 2468240
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org