Here the update.
On the forum, somebody wrote that apparently EA goes through the clipboard internally even when exporting to file, so I thought clipboard only may be faster and implemented the possiblity to use EA's export of a .bmp file to clipboard then saving that .bmp for pasting into Word/link for XML. However, performance-wise, it's a bit slower than the EA's export to .png file. For one diagram export to file, it takes between 300-500ms. For ~100 diagrams, it's ~40 seconds. When going through clipboard, for the same ~100 diagrams it takes 3 seconds more (~ +8% time).
I'm running EA 932 with Java API (Java 6, Windows 7, ThinkPad T410), and saving files to a directory that is excluded from antivirus scan-on-access. Here the code snippet:
<code>
// ...
try {
File pic = (removeAfterExit) ? Util.createTempImageFile(dirPath, fileName,
retainedFormat, removeAfterExit) : new File(dirPath, fileName);
if (throughClipboard) {
_logger.debug("Saving image from clipboard to '" + pic.getAbsolutePath() + ".");
_eaProj.PutDiagramImageOnClipboard(diagramUuid, 1);
Util.saveImageFromClipboard(pic);
} else {
_logger.debug("Saving exported image to '" + pic.getAbsolutePath() + ".");
_eaProj.PutDiagramImageToFile(diagramUuid, pic.getAbsolutePath(), 1);
}
return pic;
} finally {
_eaRep.CloseDiagram(diagramId);
_logger.debug(String.format("... saved in %s ms", System.currentTimeMillis() - start));
}
</code>
Are there any experiences with running this kind of things in a background thread? I don't want to waste time implementing if somebody can confirm it wouldn't work.
My problem with focus "stealing" is still actual - this was not happening with Windows XP, only with Windows 7; I've also reported the issue as a registered user...
Otherwise, is there any other way one could speed up diagram export?
ps Geert: SQL doesn't help here :-), but I'll spend my weekend trying it out - with help of qwerty's e-book - for model browsing because the API performance is more than sad.