Skip to content

Thoroughly nospecialize all functions; add no-alloc, no-specialize test.#14

Open
NHDaly wants to merge 1 commit into
masterfrom
nhd-nospecialize-2
Open

Thoroughly nospecialize all functions; add no-alloc, no-specialize test.#14
NHDaly wants to merge 1 commit into
masterfrom
nhd-nospecialize-2

Conversation

@NHDaly
Copy link
Copy Markdown
Member

@NHDaly NHDaly commented Jun 6, 2023

Make sure that all functions in ExceptionUnwrapping are marked nospecialize. We don't want to pay the wasted compilation time at runtime, since these are all going to be called in exceptional cases, certainly not in a hot loop, and because we've seen crashes caused by a stackoverflow in type inference while attempting to specialize the code to handle a StackOverflowException! 😅

This time, we add a unit test to ensure that that these functions do not allocate and do not incur new compilation when called with novel arguments.

This is a follow-up to #6 and #15.

@NHDaly NHDaly force-pushed the nhd-nospecialize-2 branch from d82675e to 043150c Compare June 6, 2023 18:54
NHDaly added a commit that referenced this pull request Jun 6, 2023
Unclear why this was left out from
#6...

There's still probably more improvement to be made here, but I ran into
test failures on julia master, so we're leaving that as a separate
change in #14.
NHDaly added a commit that referenced this pull request Jun 6, 2023
Unclear why this was left out from
#6...

There's still probably more improvement to be made here, but I ran into
test failures on julia master, so we're leaving that as a separate
change in #14.
@NHDaly NHDaly force-pushed the nhd-nospecialize-2 branch from 043150c to 3487afa Compare June 7, 2023 03:09
Make sure that _all_ functions in ExceptionUnwrapping are marked
nospecialize. We don't want to pay the wasted compilation time at
runtime, since these are all going to be called in _exceptional_ cases,
certainly not in a hot loop, and because we've seen crashes caused by a
stackoverflow in type inference while attempting to specialize the code
to handle a StackOverflowException! 😅

This time, we add a unit test to ensure that that these functions do not
allocate and do not incur new compilation when called with novel
arguments.
@NHDaly NHDaly force-pushed the nhd-nospecialize-2 branch from 3487afa to e50a8d0 Compare June 7, 2023 03:09
Comment thread src/exception_summary.jl
Comment on lines +116 to +118
@show exc
@show is_wrapped_exception(exc)
global EXC = exc
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a leftover from debugging

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 this pull request may close these issues.

2 participants