Freeplane-Jumper icon indicating copy to clipboard operation
Freeplane-Jumper copied to clipboard

Improve performances

Open lilive opened this issue 2 years ago • 4 comments

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 avatar Feb 17 '23 23:02 lilive

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

euu2021 avatar Mar 15 '23 21:03 euu2021

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 avatar Mar 15 '23 22:03 EdoFro

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

EdoFro avatar Mar 17 '23 22:03 EdoFro