andy-goryachev / FxEditor

JavaFX rich text editor able to handle billions of lines (WORK IN PROGRESS)
Apache License 2.0
33 stars 10 forks source link

poor performance with long lines (> 1 million symbols) #5

Open andy-goryachev opened 5 years ago

andy-goryachev commented 5 years ago

This issue makes it unusable for applications where long lines are routine, such as log viewer.

andy-goryachev commented 5 years ago

A monospaced high performance alternative FxTextEditor is being worked on, as a part of the AccessPanel project.

staypufd commented 3 years ago

Is the poor performance long lines or is it number of lines? I ask b/c the PrismaTextLayout seems to have lines, spans, runs, a linesList, and a layout cache. Maybe it may be easier to optimize the PrismaTextLayout class in OpenJavaFX? Seems like you wouldn’t have to render any lines that weren’t on screen at the time so a “view/window” over the linesList would tell which lines are on screen and give you the start and end lines to render me you could add a few extra screens worth both forward and backward to make scrolling fast maybe. You’d need to add that to the model class I’m guessing so that the UI could tell the model which lines the window/views was over. Maybe it could even be expressed as the “visibleLinesRange” and could be a Tuple or List of startLine and EndLine? Or maybe I’m missing how the PrismaTextLayout already does something like that. Just looked after I read your ReadMe that mentioned Glyph rendering slowing down for large files.

Anyway, cool work and I hope you finish this b/c it is sorely needed in the JavaFX community!

andy-goryachev commented 3 years ago

Thank you for your feedback, Sam.

Optimizing layout engine, even if it were exposed by JDK, is a non-trivial task: consider all the weird unicode composition rules, break iterators, etc.

Besides, even an optimized layout engine will take too much time laying out a long text string. For my use case, a log viewer in the AccessPanelPublic project, I had to switch to a custom monospaced layout engine, see FxTextEditor.

So I am afraid this ticket is 'won't fix'.

Anyway, thank you for the kind words. I agree - a general purpose styled text editor is definitely needed in javafx. But this project will probably require a year full time, and I do not see a lot of interest from corporate sponsors.