Opened 10 years ago

Last modified 10 years ago

#2972 new enhancement

OMEdit-omc integration for performance

Reported by: Martin Sjölund Owned by: Adeel Asghar
Priority: high Milestone: Future
Component: OMEdit Version: trunk
Keywords: Cc: Adrian Pop, fcasella

Description

OMEdit has a considerable overhead calling the omc API. With the bootstrapped compiler, we could use omc as a library rather than as a server. This bring some performance gains. We could gain even better performance by doing some Qt batch operations directly.

Consider a package like:

package OMEditStuff

package QVariantMap
class QVariantMap
  extends ExternalObject;
end QVariantMap;

function addString
  input String key;
  input String value;
end addString;

function addMap
  ...
end addMap;

end QVariantMap;

function getAllClassInformation
  input QVariantMap map; // Pointer from the OMEdit Qt program
  ...
  output QVariantMap outMap; 
  ...
algorithm
  Absyn.traverseClass(program, addClassInformationToMap, map);
end getAllClassInformation;

function addClassInformationToMap
  input Absyn.Path fullPath;
  input Absyn.Class cl;
  input QVariantMap map;
algorithm
  QVariantMap.addString(fullPath, getClassInformationStr(cl));
end addClassInformationToMap;

end OMEditStuff;

OMEditStuff (or a set of packages) could be compiled as a separate object. Nothing in OpenModelica uses them, so OMEdit could simply link in both libOpenModelicaCompiler.so and libOpenModelicaCompilerOMEditStuff.so, calling functions in OMEditStuff, which in turn calls other functions directly.

This way we could insert things directly into the data structures that OMEdit uses. I am certain it would be a lot faster than the current approach.

Change History (1)

comment:1 by Martin Sjölund, 10 years ago

r23384 added the possibility to link OMEdit against omc directly. This is not done for Windows clients (yet). I used a slightly different approach though (since structs are nicer than maps when you already know what output to expect).

Note: See TracTickets for help on using tickets.