Project: Birt
Bug 150524 ROM API very slow in read only situations
Reported: 2006-07-13 11:39:32 | Status: verified fixed

Using the ROM API to get details about a report design is very very slow. For instance the BIRT ROM API code to get a display name looks something like _url = url.getFile(); _designEngine = new DesignEngine(new DesignConfig()); _session = _designEngine.newSessionHandle(ULocale.getDefault()); _design = _session.openDesign(_url); String displayName = ""; //$NON-NLS-1$ try { displayName = _design.getDisplayName(); // there may not be a display name so return "" if (displayName == null) displayName = ""; //$NON-NLS-1$ } catch (Exception e) { e.printStackTrace(); displayName = ""; //$NON-NLS-1$ } ...... This is very slow for us... what we see is that the BIRT ROM seems to load the entire rptdesign into a model, which is very time expensive. One thing we have done for now, is written a 'light weight' class that opens the design and just quickly fetches the fields for us using simple DOM. Its way faster than using the ROM but not ideal as best code practices point out that you should use a published formal API for accessing data because custom code is often prone to breakage as data forms change over time. So we would like to see the ROM support a "fast" ROM mode, for read only access. of report attributes.

Files changed in fix:
model/org.eclipse.birt.report.model.tests/test/org/eclipse/birt/report/model/api/SessionHandleTest.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/api/IModuleOption.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/DesignParserHandler.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/GenericModuleParserHandler.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/LibraryParserHandler.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/LibraryState.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/ModuleParserHandler.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/ModuleState.java model/org.eclipse.birt.report.model/src/org/eclipse/birt/report/model/parser/ReportState.java