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

Better benchmark #110

Open
adamgundry opened this issue Nov 12, 2018 · 2 comments
Open

Better benchmark #110

adamgundry opened this issue Nov 12, 2018 · 2 comments
Assignees

Comments

@adamgundry
Copy link
Contributor

I've been looking at the existing benchmark, and it seems there are a couple of issues:

  • The state data type is [[[Int]]], which leaves lots of opportunities for laziness (e.g. when deserialising a checkpoint).
  • The benchmark merely measures the cost of opening and closing the state, without running any updates/queries which would force evaluation.

At least in some applications, it is better to use a strict state type and fully evaluate the state at load time, which might take longer but should use less memory and may avoid the first query/update running slowly due to the need to force lots of thunks in the state. The benchmark should better reflect this mode of use.

@adamgundry adamgundry self-assigned this Nov 12, 2018
@stepcut
Copy link
Member

stepcut commented Nov 12, 2018

Something else to think about is the 'memory' backend. acid-state has a backend that stores the state in memory instead of on the disk. That, of course, means the state is lost when the application exits. The purpose is to make it easier to write tests because you don't have to worry about cleaning up the files on the disk.

But perhaps it is also useful for the purpose of benchmarking? The 'memory' backend should be the fastest backend since it doesn't have to do disk I/O. So, that would give you some idea how much extra time is being spent on the disk I/O?

Perhaps its not useful, but I thought I would at least mention that it exists.

@adamgundry
Copy link
Contributor Author

I agree it would be good to have benchmarks comparing the memory backend to local backends (with various serialisation layers). I'll look at generalising the benchmarks over different backends.

adamgundry added a commit that referenced this issue Nov 27, 2018
This adds support for benchmarking multiple acid-state backends
(just the memory and local backends for now). It extends the
benchmarks to measure the initialize operation, and with variants
that issue a query after loading in order to force the state.

The use of criterion has been overhauled to avoid doing unnecessary
work if not all benchmarks are being run.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants