Skip to content

Add run number changed hook, use it to lazy-load reverse translation table#91

Merged
raffaelladevita merged 6 commits intomainfrom
reverse-tt
Apr 2, 2025
Merged

Add run number changed hook, use it to lazy-load reverse translation table#91
raffaelladevita merged 6 commits intomainfrom
reverse-tt

Conversation

@baltzell
Copy link
Collaborator

@baltzell baltzell commented Apr 2, 2025

in preparation to see if it can be sped up

@baltzell baltzell requested a review from raffaelladevita April 2, 2025 14:50
@Override
public void processEvent(DataEvent event) {

if (reverse == null) reverse = getReverseTT(forward);
Copy link
Collaborator

Choose a reason for hiding this comment

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

reverse needs to be rebuilt if the run number changes because forward can be different. That's why getReverseTT was called in createHistos

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

then need to check run number changed

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

are there other options?

Copy link
Collaborator

@raffaelladevita raffaelladevita Apr 2, 2025

Choose a reason for hiding this comment

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

createHistos is called at the start, if the run number changes, and when a manual or automatic reset is issued.

if getReverseTT is called in createHistos, it will be executed in the three cases listed above. The first (at the start) is not really useful because the run number is not known yet and could be skipped with a check on run number being non-zero

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we should really avoid blocking the UI for 10+ seconds if feasible

@baltzell baltzell changed the title cleanup Add run number changed hook, use it to lazy-load reverse translation table Apr 2, 2025
@baltzell
Copy link
Collaborator Author

baltzell commented Apr 2, 2025

much faster, not sure it's equal ...

@raffaelladevita raffaelladevita merged commit 9306502 into main Apr 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants