Skip to content

Add benchmark for get_symmetry_dataset#207

Merged
lan496 merged 3 commits intospglib:developfrom
lan496:perf
Nov 26, 2022
Merged

Add benchmark for get_symmetry_dataset#207
lan496 merged 3 commits intospglib:developfrom
lan496:perf

Conversation

@lan496
Copy link
Copy Markdown
Member

@lan496 lan496 commented Nov 26, 2022

Add benchmark script python/test/test_benchmark.py, which calls get_symmetry_dataset for all cells in python/test/data. This benchmark is not performed as default (--benchmark-skip).

Here is an example of the benchmarking:

pytest --benchmark-only --benchmark-columns=mean,stddev -s -v test/test_benchmark.py
test/test_benchmark.py::test_get_symmetry_dataset Benchmark get_symmetry_dataset on 784 structures
PASSED
----- benchmark 'space-group': 1 tests -----
Name (time in s)                Mean  StdDev
--------------------------------------------
test_get_symmetry_dataset     1.9893  0.0296
--------------------------------------------

The following changes are also added though they do not relate to the issue directly:

  • Add extra_require for pytest: pip install -e .[testing]
  • Fix typo in myst setting
  • Add developer docs for benchmark: doc/development/performance.md
  • Format layer-group implementation (accidentally)

@codecov-commenter
Copy link
Copy Markdown

Codecov Report

Base: 85.57% // Head: 85.34% // Decreases project coverage by -0.23% ⚠️

Coverage data is based on head (e52afc0) compared to base (c9fad81).
Patch has no changes to coverable lines.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #207      +/-   ##
===========================================
- Coverage    85.57%   85.34%   -0.24%     
===========================================
  Files           17       18       +1     
  Lines         1352     1358       +6     
===========================================
+ Hits          1157     1159       +2     
- Misses         195      199       +4     
Impacted Files Coverage Δ
test/vasp.py 83.07% <0.00%> (-9.24%) ⬇️
setup.py 0.00% <0.00%> (ø)
spglib/spglib.py 80.78% <0.00%> (ø)
test/test_benchmark.py 53.84% <0.00%> (ø)
test/conftest.py 93.67% <0.00%> (+8.14%) ⬆️
test/test_layergroup.py 100.00% <0.00%> (+13.33%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@lan496 lan496 requested a review from atztogo November 26, 2022 11:19
@atztogo
Copy link
Copy Markdown
Collaborator

atztogo commented Nov 26, 2022

@lan496, thanks for your these works. I confirmed the benchmark works. I read through the files changed. Thanks for improvements for non-benchmark stuff, too. pytest-benchmark was new to me. I have nothing to say than LGTM.

@lan496 lan496 merged commit 2b06c29 into spglib:develop Nov 26, 2022
@lan496 lan496 deleted the perf branch November 26, 2022 14:04
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

Successfully merging this pull request may close these issues.

3 participants