Skip to content

Additional optimizations for left function #19749

@alamb

Description

@alamb

You can probably use https://doc.rust-lang.org/std/primitive.str.html#method.char_indices here to avoid copying the strings into chars_buf entirely -- you could just find the correct offset and then copy the relevant bytes

If you wanted to get super fancy, you could add specializations for:

  1. Scalar n (no need to expand it out to an array)
  2. StringViewArray (no need to copy strings at all, you could just adjust the views)

However, this code seems better than what is on main! So we can merge it too and keep iterating

Originally posted by @alamb in #19571 (comment)

Metadata

Metadata

Assignees

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