You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2022/03/22 22:06:00 UTC
[jira] [Updated] (ARROW-16008) [C++] It is more expensive than expected to create a default Result
[ https://issues.apache.org/jira/browse/ARROW-16008?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
ASF GitHub Bot updated ARROW-16008:
-----------------------------------
Labels: pull-request-available (was: )
> [C++] It is more expensive than expected to create a default Result<T>
> ----------------------------------------------------------------------
>
> Key: ARROW-16008
> URL: https://issues.apache.org/jira/browse/ARROW-16008
> Project: Apache Arrow
> Issue Type: Improvement
> Components: C++
> Reporter: Weston Pace
> Assignee: Weston Pace
> Priority: Minor
> Labels: pull-request-available
> Time Spent: 10m
> Remaining Estimate: 0h
>
> I had expected:
> {noformat}
> Result<T> my_result;
> T my_value;
> {noformat}
> to be more or less equivalent statements (as I think of Result<T> as a "T or Status variant"). However, a default result initializes itself with an error status and the error message must be allocated and copied. As a result, it is considerably more expensive (100's of ns compared to 1's of ns).
> I'm not certain how much of an issue this is however. It's possible we don't often create default results or their creation is optimized out. I prototyped a solution but did not see much change in any benchmarks. So perhaps it is not something worth changing but I figured I'd open it up to discussion.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)