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

Evaluation performance for large numbers #56

Closed
marcellustavares opened this issue Feb 20, 2016 · 3 comments
Closed

Evaluation performance for large numbers #56

marcellustavares opened this issue Feb 20, 2016 · 3 comments

Comments

@marcellustavares
Copy link

Hey Udo, first of all thanks for the awesome library!

I'm using the EvalEx library for the Liferay portal project but we've found something that impacts the performance of some operations.

For example expression such as SQRT(9123744984893^993837) takes a lot of time to evaluate and the eval() method hangs for a while.

We can solve this at our side, but I was wondering if that's something you would like to include in your library. Something like a timed out condition for evaluations. I can send you a pull request if you think so.

Let me know what you think.

Best Regards @uklimaschewski,

@uklimaschewski
Copy link
Collaborator

Thank you, I marked this as an enhancement. If you send a pull request, I can have a look at it.

@uklimaschewski
Copy link
Collaborator

It's been a while, but today I was playing around with some possibilities for a timeout. It seems that the problems are in the BigDecimal class, which can be very slow on very large numbers. Do you have a working solution and how does it work? The only solution that I came up with, was using separate threads, but this is not nice and the Expression class is IMHO not the right place to handle this.

@marcellustavares
Copy link
Author

hey @uklimaschewski, sorry for the delay. Yeah, it's not so simple unfortunately. My workaround was to limit the numeric range of some operations to double.

It was something we could afford on our side but it's definitely not the solution for EvalEx.

Thanks a lot for all the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants