Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
In MVEL .empty can be way way way slower then .isEmpty() #5086
This happens when you use
I'm not completely sure what is happening but my guess is that the MVEL optimizer is optimizing .empty is a call to .isEmpty on an instance of either ScriptDocValues or ScriptDocValues.Empty. When it hits the wrong one it recovers by catching an IllegalArgumentException thrown by the JVM and then does some munging. The act of filling in the stack trace for that IllegalArgumentException is really really really slow. So slow, I see it in the hot threads: https://gist.github.com/nik9000/8937335 .
I'm not sure what the fix ought to be.