Book a Demo

Author Topic: SaveDiagram performance V17.1 compared to V16.1  (Read 61331 times)

OJB

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
SaveDiagram performance V17.1 compared to V16.1
« on: September 02, 2025, 11:52:39 pm »
Hi There  :)

I'm new to this forum and asking for help. I used the great content here in the past "passively" to learn Sparx EA automation.
Over time I created an extensive JavaScript library mainly focussing on diagram generation automation. I tried to achieve near-real-time response times and encountered a problem while testing V17.1 64 bit (currently using V16.1 32 bit) - with qea/SQLite databases

I have to start many automations by saving the current diagram (Repository.SaveDiagram()) to not lose user changes. With version V16 this takes about 0,1s for standard diagrams - with version V17 it is 0,8-1s (even for completely unchanged diagrams) which is a huge impact when mostly save and reload are the time consuming actions and many automations finish (in V16) in a total time below 0,3-0,5s with complex automations. So the save action is 8-10 worse in V17 compared to V16

I created a small script to measure the performance and I hope you could help verifying this behaviour or find a solution.
If you have the same experience would you see this as a bug?

Best regards, Oliver

the test script (for the Script Diagram Group) I used for the tests ...

Code: [Select]
Repository.EnsureOutputVisible("Script")
var curDG = Repository.GetCurrentDiagram()
if (curDG != null){
var start = new Date().getTime()
Repository.SaveDiagram(curDG.DiagramID)
var stop = new Date().getTime()
Repository.WriteOutput("Script", "Time: " + (stop - start) + " ms", 0)
}

Takeshi K

  • EA User
  • **
  • Posts: 632
  • Karma: +43/-1
    • View Profile
    • Sparx Systems Japan
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #1 on: September 03, 2025, 08:57:30 am »
Hi OJB,

I guess that the new snapshot feature might cause the delay. The feature saves diagram image for every saving attempt. If you enable the automatic snapshot creation feature, EA will save the image to the project. Even if not, EA generates the image of the diagram (and stores it in the memory) so it might take some time to create the image.

HTH,
--
t-kouno

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #2 on: September 03, 2025, 04:12:19 pm »
I just did a small test with the script, and I see no meaningfull difference between v16 and v17

Both saved my diagram in about 100 to 150 ms

I'm on a local SQL Server repo

Geert

OJB

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #3 on: September 04, 2025, 07:35:31 pm »
Thanks Takeshi and Geert for the fast replies  :)

@Takeshi: I will look into the snapshot feature - I wasn't aware of that - it might even get handy for me, because I already built a similar routine for diagram snapshots to use them in overview diagram setting with hyperlinks from the image to the diagram itself - but my first version is slow because I had to use a lot of file handling (exporting png, zipping around, converting to hex and pushing it back into the database  ;D)
I had a quick look and found some information, but I wasn't able to find where to set the switch. Could you provide me some further guidance please?

@Geert: What was your version for V17 and was the automatic snapshot feature Takeshi mentioned set to off?

BR, Oliver


Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #4 on: September 04, 2025, 08:53:27 pm »
v17.1.1713

I'm not sure which snapshot feature Takeshi is referencing. I guess it's the part about Timelines that we see here: https://sparxsystems.com/products/ea/17.0/history.html?

In that case I haven't done anything to enable or disable it.

Geert

OJB

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #5 on: September 04, 2025, 10:08:48 pm »
@Geert I used v17.1.1712 (no changes regarding diagram saves since then, according to the release notes)
Did you use 32bit oder 64bit?

BR, Oliver

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #6 on: September 04, 2025, 10:37:49 pm »
@Geert I used v17.1.1712 (no changes regarding diagram saves since then, according to the release notes)
Did you use 32bit oder 64bit?

BR, Oliver
I did the test with both. No difference.

Geert

OJB

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #7 on: September 04, 2025, 11:04:24 pm »
@Geert I used v17.1.1712 (no changes regarding diagram saves since then, according to the release notes)
Did you use 32bit oder 64bit?

BR, Oliver
I did the test with both. No difference.

Geert

Thanks a lot!
BR, Oliver

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: SaveDiagram performance V17.1 compared to V16.1
« Reply #8 on: September 05, 2025, 12:22:47 am »
I just checked, and snapshot feature was in fact active.
I can see the previous snapshots of my diagram.

Geert