Skip to content

Make SweepFormula a bit faster #2444

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Conversation

t-b
Copy link
Collaborator

@t-b t-b commented Jun 9, 2025

Here the SF code

selBasic = select(selchannels(AD), selsweeps(), selvis(all), selcm(ic))
selTP    = select(selrange(TP), $selBasic)
selE0    = select(selrange(E0), $selBasic)
dataTP   = data($selTP)
dataE0   = data($selE0)

#Zeroed TP traces

integrate(
derivative(
$dataTP
)
)

and

tp(tpfit(exp, amp), $selBasic)

and

# Average power spectrum of EO epoch from all IC traces

powerspectrum($dataE0, dB, avg, 0, 100)

and

# 60 hz ratio frequency from average power spectrum

store(power60HzRatio, powerspectrum($dataE0, dB, avg, 60, 100))

with 66 sweeps got here 40%.

Close #2351
Close #2398

t-b added 9 commits June 9, 2025 18:17
The function BSP_GetDevice is called quite often so let's do the expensive
part only when locking the databrowser.
This makes DB_SplitSweepsIfReq faster as we only need to fetch the device
once.
This is cheaper as we don't have to figure out the sweep datafolder.
It is not possible to store invalid wave references in the cache. Although
this can be useful to distinguish no cache entry from a cache entry
without contents.

We also tweaked the statistics output that this only outputs size zero for
really empty waves and otherwise rounds up to 1MiB.
@t-b t-b force-pushed the bugfix/2444-faster-sweepformula branch from f548dce to 5f92b8e Compare June 9, 2025 20:09
@t-b t-b assigned t-b and unassigned timjarsky Jun 9, 2025
@t-b t-b force-pushed the bugfix/2444-faster-sweepformula branch from 5f92b8e to 4e5038c Compare June 10, 2025 10:51
t-b added 3 commits June 10, 2025 12:54
We now store the fetched epochs in the cache and also the ones we filtered
for short names and treelevel.
We now split all sweeps when locking the databrowser. New sweeps are
already split on saving, see SWS_SaveAcquiredData.

This makes SweepFormula faster as it does not need to care about sweep
splitting anymore.
@t-b t-b force-pushed the bugfix/2444-faster-sweepformula branch from 4e5038c to 974fb20 Compare June 10, 2025 10:54
@t-b t-b added the IVSCC label Jun 10, 2025
@t-b t-b assigned timjarsky and unassigned t-b Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow storing null wave refs in the cache Investigate SF slowness for custom IVSCC code
2 participants