Skip to content

speed of copying with iterators #29

@user706

Description

@user706

Is this not "slow(ish)", when using the standard copying mechanisms:

std::copy(rs.cbegin(), rs.cend(), out_it)

??

It'll call this unnecessary code on each iterator-dereference:
https://github.com/martinmoene/ring-span-lite/blob/b8135cd85499a2d5482e048eb8fb6b354350d427/include/nonstd/ring_span.hpp#L968
which calls the slowish https://github.com/martinmoene/ring-span-lite/blob/b8135cd85499a2d5482e048eb8fb6b354350d427/include/nonstd/ring_span.hpp#L836
on each dereference!!!

Should ring and ring_span not have some facilities to speed up copying?

ring_span::copy(InputIt first, InputIt last, OutputIt d_first);              // copy from ring_span to something else
ring_span::copy(InputIt first, InputIt last, ring_span &, OutputIt d_first); // copy from ring_span to ring_span
// etc.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions