Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-10683

[Rust] Remove Array.data method in favor of .data_ref to make performance impact of clone more obvious

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • Rust
    • None

    Description

      The `Array.data()` method is a real performance foot-gun since it involves cloning an `Arc` which is not obvious to users. When used in innner loops that can cause big performance impacts. The cloning itself might not be a problem, but I think it sometimes prohibits other compiler optimizations.

      It would be better to remove this method and let users call `array_ref()` and only clone when really needed.

      Most of the current usages seem to be in test assertions which should be easy to refactor.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jhorstmann Jörn Horstmann
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: