lilive / Freeplane-Jumper

A search box for Freeplane with on-the-fly filtering and full keyboard control. Quick navigation in your maps!
32 stars 3 forks source link

Improve performances #16

Open lilive opened 1 year ago

lilive commented 1 year ago

Jumper is near unusable with very big maps. I open this issue to inform the user who may wait for improvement.

A first step would be to implement multi threading. I've already worked on it, but I struggle with concurrency problems. Some help about Java multi threading would be nice.

Because Jumper work with plain text, and not with HTML/Markdown formatted text, it has to generate this plain text for nodes with formatted text. This is time consuming for large maps. So, another idea would be to cache a plain text version of the map. But I'm reluctant to introduce some map changes monitoring that may update the cache as the user modify the map.

Another idea may be to try to rewrite some parts of Jumper in Java instead of groovy, perhaps this speed up thinks. Wait ! I just realize that I never read nothing about Groovy performances and optimization. I have to. Any pointer on good resources on this topic are welcome.

lilive commented 1 year ago

Discussion about the problem in the old forum.

euu2021 commented 1 year ago

The "Find and Replace" in Freeplane performs very well. Isn't it possible to get inspiration from it?

EdoFro commented 1 year ago

Because Jumper work with plain text, and not with HTML/Markdown formatted text, it has to generate this plain text for nodes with formatted text.

With HTML is no problem. the problem is with the Markdown formatted text.

For HTML you can use:

println node.plainText
println node.details.to.plain
println node.note.to.plain

it would be nice to have direct access (as read only) to the html generated from the markdown, and to the plain text after that.

EdoFro commented 1 year ago

I was looking at the Freeplane code and saw that the method used to transform from html to plain get cached, that's why it's so fast in Freeplane to search for terms:

look here: https://github.com/freeplane/freeplane/blob/839669f4d6870208a73b8bce648a1a6805e3efb9/freeplane/src/main/java/org/freeplane/core/util/HtmlUtils.java#L115

So it may be a good solution to use

node.plainText
node.details.to.plain
node.note.to.plain

for your searches