Skip to content

Commit

Permalink
Test overhead of large amounts of non-rootish tasks (#903)
Browse files Browse the repository at this point in the history
  • Loading branch information
crusaderky authored Jul 6, 2023
1 parent acbcd92 commit 1b31742
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 2 deletions.
30 changes: 30 additions & 0 deletions alembic/versions/9813b7160e69_parametrize_test_large_map.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""Parametrize test_large_map
Revision ID: 9813b7160e69
Revises: f459b2c61eaf
Create Date: 2023-07-05 11:04:08.510205
"""
from alembic import op


# revision identifiers, used by Alembic.
revision = '9813b7160e69'
down_revision = 'f459b2c61eaf'
branch_labels = None
depends_on = None


def upgrade() -> None:
op.execute(
"""
update test_run
set name = 'test_large_map[rootish]'
where name == 'test_large_map';
"""
)

def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
pass
# ### end Alembic commands ###
14 changes: 12 additions & 2 deletions tests/benchmarks/test_futures.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,19 @@ def test_single_future(small_client):


@run_up_to_nthreads("small_cluster", 50, reason="fixed dataset")
def test_large_map(small_client):
@pytest.mark.parametrize("rootish", ["rootish", "non-rootish"])
def test_large_map(small_client, rootish):
"""What's the overhead of map these days?"""
futures = small_client.map(inc, range(100_000))
if rootish == "rootish":
futures = small_client.map(inc, range(100_000))
else:

def inc_with_deps(i, deps):
return i + 1

deps = small_client.map(inc, range(5))
futures = small_client.map(inc_with_deps, range(100_000), deps=deps)

wait(futures)


Expand Down

0 comments on commit 1b31742

Please sign in to comment.