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

Question: Reusing Expression vs creating new one (Timer Calculation) #6

Open
ayman-metwally-developer opened this issue Jul 25, 2018 · 2 comments

Comments

@ayman-metwally-developer

Greetings,

I'm asking about the proper use from the designer point of view .. I'm evaluating hundreds of formulas per second .. it it normal to re-instantiate an object (New Expression) so frequently?

Regards,
Ayman

@yallie
Copy link
Member

yallie commented Jul 25, 2018

Hi Ayman,

sure, why not?

If you're evaluating the same formula all over again with different parameters,
just avoid parsing and reuse a parsed parameterized expression.

@gumbarros
Copy link
Member

gumbarros commented Apr 22, 2024

Years later to the party, but I think it's a valid point. Maybe a Object Pool solves this problem, but for this, Expression would need a Reset method or something to clear all the state, I don't know if it's worth.

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

3 participants