-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
elide more tuple allocations #1976
Comments
These profiling investigations promise to be very helpful. |
I was probably getting too cute when writing the chkstride and chksquare functions. Having looked at other code, which I believe was written by Jeff, I think that more liberal use of assert() is the better path. I just got tired of writing if (stride(A,1) != 1) error("Matrix X must have contiguous columns") end |
|
I submitted a pull request a while back with a corresponding |
I believe there's a push towards pushing more typed errors forward for handling errors programmatically. |
That would be nice, but seems to go against the decision not to have typed catch clauses? |
I would say that informative is good. If there's no bug that's triggering excess gc, I'll close this. The issue of reducing temporaries/gc will surely be up front-and-center in future optimization efforts. |
Oops, from the fact that someone changed the title, it seems this is better left open. Reopening. |
Dup of #2496 . |
One hope with the sampling profiler is making our code more efficient; the curse may be that it will trigger questions about things that don't actually matter.
In that spirit, I've gotten the impression that anytime a tuple is involved, there's a likelihood of triggering the garbage collector. It's interesting to run the sampling profiler on the following function:
A large fraction of the samples are taken inside the garbage collector. But at least on my machine, they're not where I expected: they seem to occur inside chkstride1.
I can eliminate many of these "weird" garbage collection events by defining additional functions:
Then there are still plenty of garbage collection events (so I think this doesn't change performance), but this time they're in a place that seems to make more sense,
jl_alloc_array_1d
.If we get to a point where we can re-use memory in assignments, I wonder if the tuple behavior will become a source of trouble?
I'm asking this in part because I noticed, long ago, that gc was the main bottleneck for the Grid module. At the time, I found this very weird because I designed it to do as little memory allocation as possible. I haven't had time to follow this up recently, however.
Anyway, it was something I found curious, and felt I'd ask about it.
The text was updated successfully, but these errors were encountered: