Skip to content
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

Move restrict to a faster loading package? #69

Closed
IanButterworth opened this issue Jul 20, 2019 · 6 comments · Fixed by #127
Closed

Move restrict to a faster loading package? #69

IanButterworth opened this issue Jul 20, 2019 · 6 comments · Fixed by #127

Comments

@IanButterworth
Copy link
Member

Is there a way to get the restrict function with faster load times?

julia> @time using ImageTransformations: restrict
  3.119409 seconds (6.69 M allocations: 376.407 MiB, 4.46% gc time)
julia> exit()
...
julia> @time using ImageTransformations: restrict
  3.212386 seconds (6.69 M allocations: 376.411 MiB, 4.51% gc time)
@johnnychen94
Copy link
Member

johnnychen94 commented Dec 13, 2020

@timholy how do you think of moving restrict to ImageCore? That way ImageShow could also benefit from this.

https://github.com/JuliaImages/ImageShow.jl/blob/af71e1e1cf012ca1a663325398a17a07f7b79bef/src/showmime.jl#L127-L135

@IanButterworth IanButterworth changed the title Slow package loading time (only need restrict()) Move restrict to a faster loading package? Dec 13, 2020
@timholy
Copy link
Member

timholy commented Dec 15, 2020

I'm supportive of the idea of splitting it out but a bit reluctant to move it to ImageCore, simply because there are no other "algorithms" in there: it's all traits and views.

We could make a separate ImageUtils package and put it there. We could also split out a subpackage from this one and register it separately, e.g., ImageTransformationsRestrict, and it could continue living here. Other thoughts?

@johnnychen94
Copy link
Member

Haven't tried it out, but perhaps we could take advantage of https://github.com/JuliaPackaging/Preferences.jl to come up with a way to lazily compile the module, i.e., if we only need a function, then only compile related parts?

@IanButterworth
Copy link
Member Author

It's been a while since I opened this issue.. and load time (and precomp time) has, as expected, improved with 1.6

julia> @time using ImageTransformations
  1.839368 seconds (3.92 M allocations: 285.683 MiB, 4.28% gc time, 18.44% compilation time)

I'm not too worried anymore, but don't let that stall the idea if you think it's still worth it

@johnnychen94
Copy link
Member

among the 1.8seconds using time, about 0.8 seconds are contributed by Interpolations/CoordinationTransformations/StaticArrays, so it definitely worth if we can skip loading them; especially it will be more convenient if we can make ImageShow always loaded with the better restrict implementation.

@johnnychen94
Copy link
Member

johnnychen94 commented May 20, 2021

I plan to make ImageUtils on top of ImageCore, and then move restrict there.

Because the main purpose of ImageUtils is to boost loading time, it needs to be very conservative to dependencies outside JuliaImages.

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 a pull request may close this issue.

3 participants