-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
significant performance regression versus 0.3.0 #169
Comments
Darn, this is probably due to the trait refactoring I did in #163. |
Does #170 fix this for your real use case? |
It looks like #170 fixes the above. Thanks for the quick fix! Unfortunately I'm still running into a few performance issues when slicing. I think these aren't new, however (tested with v0.3.0 as well as #170) x=rand(3,3)
y=rand(3)
a=AxisArray(x, [:x,:y,:z], [:foo1, :foo2, :foo3])
au=AxisArray(uview(x), [:x,:y,:z], [:foo1, :foo2, :foo3])
# With AxisArrays
@btime $y .= view($a, :x, :)
# 500.005 ns (3 allocations: 96 bytes)
@btime $y .= view($au, :x, :)
# 357.435 ns (2 allocations: 96 bytes)
@btime $y .= view($au, 1, :)
# 358.857 ns (2 allocations: 96 bytes)
@btime $y .= $au[:, 1]
# 275.429 ns (3 allocations: 160 bytes)
# Without AxisArrays
@btime $y .= view($x, 1, :)
# 15.149 ns (1 allocation: 48 bytes)
@btime $y .= uview($x, 1, :)
# 14.594 ns (0 allocations: 0 bytes)
@btime $y .= $x[:, 1]
# 29.032 ns (1 allocation: 112 bytes) So it appears that any kind of slicing, with or without |
Symbol-based indexing will always have a performance hit of some kind. I'm not so sure whether the integer slicing performance hit relative to normal arrays is expected — feel free to open a separate issue for that if you like. |
What's |
They are stack-allocated array views from UnsafeArrays.jl. They are quite
useful for getting maximally performant code.
Colin X Summers
University of Washington
Personal Robotics Lab
www.colinxsummers.com
…On Sat., 31 Aug. 2019, 04:47 Tim Holy, ***@***.***> wrote:
What's uview?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#169?email_source=notifications&email_token=AELLS2EEWZNYHNPXANF265LQHJK6JA5CNFSM4IRZ64F2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5TLGAI#issuecomment-526824193>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AELLS2CB6JPPP7UDEJX2M6DQHJK6JANCNFSM4IRZ64FQ>
.
|
I bumped the project version to 0.3.3 so we can have this bug fixed. @JuliaRegistrator register |
Registration pull request created: JuliaRegistries/General/3239 After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version. This will be done automatically if Julia TagBot is installed, or can be done manually through the github interface, or via:
|
v0.3.0:
5.115 ns (0 allocations: 0 bytes)
v0.3.1 and v0.3.2
294.645 ns (3 allocations: 80 bytes)
versioninfo:
The text was updated successfully, but these errors were encountered: