-
-
Notifications
You must be signed in to change notification settings - Fork 35
benchmarking infrastructure #24
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
Changes from 1 commit
25233c2
7857b4a
9f79e9a
31b504f
c000f52
2e9c8ab
77fedc5
26a4974
06ef1ae
f8e417d
c5c40f4
8b04a87
f805169
6f8d0d3
e40ac1e
9c757d0
5aba95e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,3 +127,7 @@ dmypy.json | |
|
|
||
| # Pyre type checker | ||
| .pyre/ | ||
|
|
||
| # asv | ||
| results/ | ||
| html/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| ## Preview benchmarks locally | ||
|
|
||
| 1. clone this repo | ||
| 2. `cd benchmarks` | ||
| 3. `asv run` will run the benchmarks on last commit (or `asv continuous base_commit_hash test_commit_hash` to run the benchmark to compare two commits) | ||
| 4. `asv publish` will create a `html` folder with the results | ||
| 5. `asv preview` will host the results locally at http://127.0.0.1:8080/ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| { | ||
| "version": 1, | ||
|
|
||
| "project": "nx-parallel", | ||
|
|
||
| "project_url": "https://github.com/networkx/nx-parallel", | ||
|
|
||
| "repo": "..", | ||
|
|
||
| "branches": ["main"], | ||
|
|
||
| "build_command": [ | ||
| "python -m pip install build hatchling", | ||
| "python -m build .", | ||
| "PIP_NO_BUILD_ISOLATION=false python -mpip wheel --no-deps --no-index -w {build_cache_dir} {build_dir}" | ||
| ], | ||
|
|
||
| "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"], | ||
|
|
||
| "dvcs": "git", | ||
|
|
||
| "environment_type": "virtualenv", | ||
|
|
||
| "show_commit_url": "https://github.com/networkx/nx-parallel/commit/", | ||
|
|
||
| "matrix": { | ||
| "networkx":[], | ||
| "nx-parallel": [] | ||
| }, | ||
|
|
||
| "benchmark_dir": "benchmarks", | ||
|
|
||
| "env_dir": "env", | ||
|
|
||
| "results_dir": "results", | ||
|
|
||
| "html_dir": "html", | ||
|
|
||
| "build_cache_size": 8 | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| import networkx as nx | ||
| import nx_parallel as nxp | ||
|
|
||
|
|
||
| class BetweennessCentralityBenchmark: | ||
| params = [("parallel", "normal")] | ||
| param_names = ["algo_type"] | ||
|
|
||
| def setup(self, algo_type): | ||
| self.algo_type = algo_type | ||
|
|
||
| def time_betweenness_centrality(self, algo_type): | ||
| num_nodes, edge_prob = 300, 0.5 | ||
| G = nx.fast_gnp_random_graph(num_nodes, edge_prob, directed=False) | ||
| if algo_type == "parallel": | ||
|
||
| H = nxp.ParallelGraph(G) | ||
| _ = nx.betweenness_centrality(H) | ||
| elif algo_type == "normal": | ||
| _ = nx.betweenness_centrality(G) | ||
| else: | ||
| raise ValueError("Unknown algo_type") | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.