Skip to content

Conversation

@laborg
Copy link
Contributor

@laborg laborg commented Dec 23, 2024

Fixes #115

With this PR the src is iterated instead of the probably longer destination.

Performance is better on this PR:

a,b=ChainedVector([rand(Int,5) for _ in 1:20000]),[1:100000...] # many chunks
@btime map!(i->-i,a,b)
# main: 188us
# pr: 153us

a,b=ChainedVector([[1:100000...]]),[1:100000...] # one chunk
@btime map!(i->-i,a,b)
# main: 171us
# pr: 73.8us

the longer `dest` was iterated, leading to an error if `src` was shorter than `dest`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

map!(f,dest::ChainedVector,src::AbstractArray) doesn't work for shorter src

1 participant