Skip to content

Commit

Permalink
Try to track down codspeed failure
Browse files Browse the repository at this point in the history
  • Loading branch information
j6k4m8 committed Apr 17, 2024
1 parent db744a1 commit 0850485
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
pip install flake8 pytest pytest-cov pytest-codspeed
# Install "cmake", "cython" for networkit. Must happen first:
pip install --upgrade cmake cython
pip install -e ".[sql,networkit,igraph]"
pip install -e ".[sql]"
- name: Run benchmarks
uses: CodSpeedHQ/action@v2
Expand Down
8 changes: 4 additions & 4 deletions grand/backends/test_backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,18 @@ def test_directed_degree_multiple(self, backend):
def test_node_addition_performance(backend):
backend, kwargs = backend
G = Graph(backend=backend(directed=True, **kwargs))
for i in range(10000):
for i in range(1000):
G.nx.add_node(i)
assert len(G.nx) == 10000
assert len(G.nx) == 1000


@pytest.mark.benchmark
@pytest.mark.parametrize("backend", backend_test_params)
def test_get_density_performance(backend):
backend, kwargs = backend
G = Graph(backend=backend(directed=True, **kwargs))
for i in range(10000):
for i in range(1000):
G.nx.add_node(i)
for i in range(10000 - 1):
for i in range(1000 - 1):
G.nx.add_edge(i, i + 1)
assert nx.density(G.nx) <= 0.005

0 comments on commit 0850485

Please sign in to comment.