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

Benchmarking #98

Open
goodmami opened this issue Feb 5, 2021 · 2 comments
Open

Benchmarking #98

goodmami opened this issue Feb 5, 2021 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@goodmami
Copy link
Owner

goodmami commented Feb 5, 2021

It would be very useful to have a benchmarking system in place, as some changes to the queries or to the schema have had big effects on performance. Recently I tried adding an index to a table to speed up the removing of lexicons, but adding a lexicon slowed to a crawl.

The benchmark suite should test a range of actions:

  • Adding a lexicon (insert performance)
  • Removing a lexicon
  • Constrained queries (tests query efficiency, indexes)
  • Unconstrained queries (tests Python data structure creation)
  • Path queries

It should be easy to run these benchmarks across several versions, to see timing deltas.

The pytest-benchmark package might be useful for this. Or, as it's not critical functionality, we could limit it to Linux/macOS and use some shell scripts around the time command or Python's timeit. For time, the following alias is helpful as it gets memory usage (rss) and the exit code, too:

alias bnch='/usr/bin/time -f "\
  real\t%es
  user\t%Us
  sys\t%Ss
  rss\t%MK
  exit\t%x" "$@"'

I'm labeling this issue as help wanted as it doesn't require much knowledge of Wn's internals and, however nice it would be, is not the highest priority at the moment.

@goodmami goodmami added enhancement New feature or request help wanted Extra attention is needed labels Feb 5, 2021
@dpalmasan
Copy link

I can help with this, but it might take me some time as I need to become familiar with the code :)

@goodmami
Copy link
Owner Author

goodmami commented Apr 9, 2021

That would be great, thanks! Some notes:

  • This should not result in any code in the wn/ subdirectory.
  • If you go with shell scripts, I prefer Linux/macOS as I don't have a Windows system to test on, and the scripts should go in a subdirectory like bench/ or benchmark/ or something, with a README.md explaining how to run them.
  • Or if you go with pytest-benchmark or similar, there would be a new testing dependency and the benchmarks would be implemented under the tests/ subdirectory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants