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

Enable panic handling in release mode? #10

Closed
valadaptive opened this issue Jul 18, 2024 · 2 comments
Closed

Enable panic handling in release mode? #10

valadaptive opened this issue Jul 18, 2024 · 2 comments

Comments

@valadaptive
Copy link

Right now, there's code to catch panics and display them as error dialogs, but it only runs in debug mode. Is there a significant performance or binary size cost to enabling this in release mode as well? There are many benefits of doing so:

  • Many debug builds run quite slowly. Being able to debug panics with fast release builds would be helpful.
  • If you don't use debug builds at all because they're so slow, you may not even be aware that the panic handler exists and is a very helpful debugging tool. I only learned about it when you mentioned it in Parameters' UI flags cannot be modified in-place #6.
  • If an effect panics and it is caught, users can save their work instead of having After Effects instantly crash and lose it all.
  • Displaying the panic message in the dialog box allows users to file more descriptive bug reports that point to the offending code.
@AdrianEddy
Copy link
Owner

I haven't benchmarked it, but I just did that to make sure to not any additional overhead, since generally the plugins are performance critical. I think we can make that the default feature flag, available to turn off by the plugin author if necessary

@AdrianEddy
Copy link
Owner

Looks like catch_unwind is not great for performance so I don't think adding it by default is a good idea in this case. Instead, I documented it in the README advising to add change optimization level of the debug builds.

I added the panic handler as an optional feature ("catch-panics")

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

No branches or pull requests

2 participants