-
Notifications
You must be signed in to change notification settings - Fork 880
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor edits to benchmarking code (#1985)
* Make RandomActivationByType.agents_by_type backward compatible * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * updated warning * Update .gitignore * Update global_benchmark.py * pep8 rename * Update schelling.py * Update schelling.py * Update schelling.py * Update schelling.py * Squashed commit of the following: commit c0de4a1 Author: Ewout ter Hoeven <[email protected]> Date: Sun Jan 21 14:43:08 2024 +0100 Add CI workflow for performance benchmarks (#1983) This commit introduces a new GitHub Actions workflow for performance benchmarking. The workflow is triggered on `pull_request_target` events and can be triggered with a "/rerun-benchmarks" comment in the PR. It should be compatible with PRs from both forks and the main repository. It includes steps for setting up the environment, checking out the PR and main branches, installing dependencies, and running benchmarks on both branches. The results are then compared, encoded, and posted as a comment on the PR. * Revert "Squashed commit of the following:" This reverts commit 9485087. * Update .gitignore * further updates * Update benchmarks/WolfSheep/__init__.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
- Loading branch information
1 parent
72b0a9d
commit 4d0eeec
Showing
8 changed files
with
135 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from .wolf_sheep import WolfSheep | ||
|
||
if __name__ == "__main__": | ||
# for profiling this benchmark model | ||
import time | ||
|
||
# model = WolfSheep(15, 25, 25, 60, 40, 0.2, 0.1, 20) | ||
model = WolfSheep(15, 100, 100, 1000, 500, 0.4, 0.2, 20) | ||
|
||
start_time = time.perf_counter() | ||
for _ in range(100): | ||
model.step() | ||
|
||
print(time.perf_counter() - start_time) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters