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
Avoid expensive Throwable.fillInStackTrace call on each batch execution #3996
Avoid expensive Throwable.fillInStackTrace call on each batch execution #3996
Conversation
f43c5df
to
22392e1
Compare
Thank you for your contribution! Did you run any actual tests with JMH? It looks like your code actually works slower in warmed up JVM. |
Before patch
After patch
As I can see there is clear speed up for small count of rows. For bigger count of rows performance change is within error boundaries. |
I tested another case when there were exceptions. I have an idea how to speed up both cases, but I need to test it. |
I think we are more interesting in case, when there are no exceptions. It's what usually happen during normal application execution. |
Your fix is good enough for original problem with performance, but there is another one and its solution requires reimplementation of the whole batch execution. |
Superseded by #3997. Thank you again for pointing this out! |
When I profiled my application, I noticed suspicious calls to
Throwable.fillInStackTrace
.I propose to use
ArrayList
instead ofSQLException
as storage for batch exceptions.