-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
Open
Labels
error handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the user
Description
We're increasingly seeing this kind of manual optimization in Base code:
function f(...)
check_cond() || throw(SomeError(...))
end
rewritten as
@noinline throw_some_error(...) = throw(SomeError(...))
function f(...)
check_cond() || throw_some_error(...)
end
It would be great if the compiler could figure this out and do the transformation automatically. I don't think it needs to be terribly complicated either: throw
should never be a common code path in Julia and throwing each kind of error could be its own outlined function, which would avoid an explosion of these automatically outlined throw functions.
schneiderfelipe, NHDaly and rfourquetPallHaraldsson and NHDaly
Metadata
Metadata
Assignees
Labels
error handlingHandling of exceptions by Julia or the userHandling of exceptions by Julia or the user