You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@arrow.apache.org by "Todd Farmer (Jira)" <ji...@apache.org> on 2022/09/06 16:51:00 UTC

[jira] [Commented] (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:comment-tabpanel&focusedCommentId=17600888#comment-17600888 ] 

Todd Farmer commented on ARROW-16008:
-------------------------------------

This issue was last updated over 90 days ago, which may be an indication it is no longer being actively worked. To better reflect the current state, the issue is being unassigned per [project policy|https://arrow.apache.org/docs/dev/developers/bug_reports.html#issue-assignment]. Please feel free to re-take assignment of the issue if it is being actively worked, or if you plan to start that work soon.

> [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: 1h
>  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.10#820010)