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

Consider optimisations of async configuration hotpaths for synchronously-provided results #18

Open
reisenberger opened this issue Jan 20, 2019 · 2 comments

Comments

@reisenberger
Copy link
Member

It seems reasonable that the delegates used to configure async MonkeyPolicy instances allow users to provide an async lambda. This permits users make async calls to consult some config source, for the enabled toggle, the injectionRate, or indeed what Exception, TResult, TimeSpan is going to be injected in fault scenarios. Currently the signatures we provide for such delegates are of the form Func<..., Task<bool>>, Func<..., Task<double>>, Func<..., Task<Exception>>, Func<..., Task<TResult>> etc.

That said, many (perhaps even a majority) usages might be sync. Simmy offers overloads taking constant values. Even for config-driven cases, it might be preferable for looking up the config to be a rapid in-memory check, with new values being pushed into that in-memory store by some other process (callback/monitor) when the underlying config source changes.

We want users to be able to include MonkeyPolicy in prod/whatever systems with minimal perf impact on executions, so want to optimise to minimise allocations and execution time.

Propose: Consider the use of ValueTask<>. Refs;

@mebjas
Copy link
Member

mebjas commented Apr 11, 2019

This is great. I'll look into this one. Is there a way to do a benchmark test on some small sample to have measurable perf impact on large / small load and maybe automate it with each deployment - some known Github tooling?

@vany0114
Copy link
Member

@mebjas do you mean a benchmark tool? if so, maybe we can use this one

Benchmark idea is great.

@vany0114 vany0114 self-assigned this Oct 22, 2019
@vany0114 vany0114 mentioned this issue Oct 23, 2019
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