Skip to content
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

Speed up test_sorting_s3_nwb_zarr #2767

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

chrishalcrow
Copy link
Collaborator

@chrishalcrow chrishalcrow commented Apr 26, 2024

Speed up a very slow test, by only checking some units, cutting the total test run from 33->28 minutes!

A preview of the Great-Test-Speed-Up of 2024: SpikeInterface/SpikeInterface-Hackathon-Edinburgh-May24#8
(This seemed too easy and impactful to wait until the hackathon)

The function test_sorting_s3_nwb_zarr downloads a sorting object from s3 and checks some things about it. This has traditionally taken a while because the object is pretty big and has ~450 units. Most of the testing time was spent looping over these 450 units and calculating their spike trains. This is probably overkill, so I propose to only check a random selection of 3/450 units.

You can see the overall speed-up here, from my github page (I realise these are failing, but they are attempting all the tests!!):

Screenshot 2024-04-26 at 12 51 09 (from https://github.com/chrishalcrow/spikeinterface/actions )

@chrishalcrow chrishalcrow added testing Related to test routines performance Performance issues/improvements labels Apr 26, 2024
@chrishalcrow chrishalcrow changed the title Speed up s3 nwb zarr Speed up test_sorting_s3_nwb_zarr Apr 26, 2024
@alejoe91 alejoe91 merged commit 584d850 into SpikeInterface:main Apr 29, 2024
11 checks passed
check_sortings_equal(sorting, sorting_loaded)

# just take 3 random units to test
rng = np.random.default_rng(seed=2205)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seed is my brithday :)
You can put your own one if you want!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll celebrate your birthday every time I do a randomised test ;)

@chrishalcrow chrishalcrow deleted the speed-up-s3-nwb-zarr branch April 29, 2024 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Performance issues/improvements testing Related to test routines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants