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

Use PNG metadata to prevent updating #112

Open
Phaiax opened this Issue Mar 28, 2018 · 2 comments

Comments

Projects
None yet
2 participants
@Phaiax

Phaiax commented Mar 28, 2018

Hi
I use plantuml within doxygen and there I generate a lot of graphs. These are rebuild every time i start doxygen and that takes more and more minutes. So now I am looking for a possibility to shorten that time.

I thought that maybe I can modify plantuml:

  • look if the output file already exists
  • if it exists, then extract the original uml source from the png metadata
  • if the previous and current source are the same, don't create the diagram and exit

Is that possible?
Can you point me to the source code where to make that change?

Thanks,
Phaiax

@arnaudroques

This comment has been minimized.

Contributor

arnaudroques commented Mar 28, 2018

That's a very good idea!
It's not very difficult to implement for us. The only issue is that this part of code is very old, and probably need some refactoring before doing the change.
If you are curious, you can start at

private static boolean manageFileInternal(File f, Option option) throws IOException, InterruptedException {

You'll see that at the begining of the method, metadata is read.
Then for historical reason, there are two classes SourceFileReader and SourceFileReader2 that are close (and contain duplicated code, which is very bad). So those classes should probably be merged. With one difficult : SourceFileReader is part of the public API and cannot be changed.

The class BlockUml may be impacted also.

Don't take too much time on this : I think we will take the job :-)
Thanks for the idea anyway!

@arnaudroques

This comment has been minimized.

Contributor

arnaudroques commented Apr 7, 2018

In last beta http://beta.plantuml.net/plantuml.jar
we have added a flag -checkmetadata
With this flag, PNG files are not generated if metadata has not changed.
You can try it with -verbose flag. Some message is displayed when generation is skipped :
java -jar plantuml.jar -verbose -checkmetadata demo.txt

This has not been widely tested, so feedback is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment