Skip to content

Optimize repeat function #14610

@alamb

Description

@alamb

Is your feature request related to a problem or challenge?

While reviewing #14575 from @wForget I noticed that the implementation of repeat could be better

Specifically, it calls String::repeat which allocates and copies the string (before append_value copies it again)

Describe the solution you'd like

I think we could avoid the allocation (aka the call to String::repeat)

Describe alternatives you've considered

I think we could avoid the copy using the Write implementation as explained on

https://docs.rs/arrow/latest/arrow/array/type.GenericStringBuilder.html#example-incrementally-writing-strings-with-stdfmtwrite

Additional context

No response

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions