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

Speedup in AlbTextEditorLineSegmentPieceMap #35

Merged

Conversation

tinchodias
Copy link
Collaborator

This optimizes a bit dragging the scroll bar.

See: #34

In my informal profile measurements, I saw a 2x speedup in selectionRectangles , still slow.
I enclosed this calculation in a [ ] timeToRun and log shows between 5ms and 12ms on each execution. Probably we can achieve 0ms by caching. Still understanding what's the motivation of this selectionRectangles. Solutions may be caching the result, or count with the inverted Dictionary that it now problematic (one where we search over the keys of it, not the values).

Maybe @plantec has an idea

This optimizes a bit dragging the scroll bar
@tinchodias
Copy link
Collaborator Author

After mocking selectionRectangles ^ #() I see more reasonable profile results...
10% layout
13% measuring text extent via Cairo
28% drawing with Cairo
Bah... at least FFI starts to be more relevant in the profiler result, I think that makes sense as for the moment we are redrawing each time. Anyway if we do a step back, we could avoid measuring text and redrawing if it really didn't change. On this could help pharo-graphics/Bloc#268

@tinchodias
Copy link
Collaborator Author

@plantec I marked it "WIP" (work in progress) because I wanted to push more commits before merging... but finally didn't do more. Do you agree to merge it, isn't it? it 's a refactoring that speedsup.

@tinchodias tinchodias changed the title Refactoring in 2 method of AlbTextEditorLineSegmentPieceMap [WIP] Speedup in AlbTextEditorLineSegmentPieceMap Nov 17, 2023
@tinchodias tinchodias merged commit d16d812 into master Nov 17, 2023
@tinchodias tinchodias deleted the 34-Drag-scroll-bar-in-a-medium-sized-string-is-too-slow branch November 17, 2023 14:20
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.

None yet

1 participant