-
Notifications
You must be signed in to change notification settings - Fork 17
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
Solves some type instability issues, or diminishes its effects #92
Conversation
I tried to solve this by annotating the expected type in different places. |
I don't like the solution (type annotations) either, but at least solves the issue partially. I agree that not being too careful about what we construct, leads to this problem. I simply provided this solution, because it makes my computations nearly a factor 2 faster. (I still need to make other improvements.) |
Tests actually work fine in Julia v0.5, but take 10x more! |
The point is that some uses of these function/macro involve a function "as an argument", which is known to be bad for performance.
Part of the problem of loosing type stability is related to the fact that some macros/functions, in a way, pass a function as an argument. This happens often when we are changing the rounding mode. I just pushed a new commit (that only deals with the problematic functions in |
Passing functions as arguments is no longer slow in 0.5 since JuliaLang/julia#13412, so I'm not sure those changes are necessary. |
I've done some tests (only for
Comparing Julia 0.4 vs 0.5, 0.5 is better (both in master and in b1f96b). Comparing master vs b1f96b, I think b1f96b does something really good, both in elapsed time as in the allocated memory, and for both Interval cases considered, in particular for |
So I agree with your comment above, that 0.5 solves many things, but b1f96ba too. |
I think the origin of the problem is in this kind of thing:
|
I don't see how to fix it though. However, if in 0.5 this is no longer a problem, then I don't think it's worth worrying too much about? |
I agree that somewhere in Though I think this is important (see the benchmarks), if you prefer we can leave this for now, and I'll take a look on this. So we can tag a new version as you wanted. |
Since the type instability no longer occurs on 0.5 after the functions rewrite, I am going to close this. If you don't agree, feel free to reopen. |
Aims to solve, or at least diminish the consequences noticed in #91