Karlsruhe Institute of Technology (KIT)Project specific questions and answers from the work at the Karlsruhe Institute of Technology.RE: Storing attribute values in DB and retrieving themWilfrid Utzhttps://www.adoxx.org/live/en_GB/c/message_boards/find_message?p_l_id=&messageId=895582014-03-18T10:12:17Z2014-03-18T10:06:31Z<span style="font-size: 12px"></span>We did have a look at the case with the aim to understand the performance issues you face. In order to test and validate the scenario, I did setup a dummy modeltype with a single class and and the table as described in your message. In addition, I also added an event log to that implementation to trace the time from trigger of the script to finalization. Please find a short analysis below with a model containing 24 instances, each with 8 different XML documents setup in the table and pointing to an about 100KB XML file:<br /><br />For the analysis, we make use of a self-developed EVENT Debugging Panel to capture the times it takes to perform the script and compare start and end times. To add this to your library, copy the following lines into the "AppInitialized" EVENT of the "External coupling" library attribute:<div class="code"><span class="code-lines"> 1</span># create the dockable window for the output stream<br /><span class="code-lines"> 2</span>CC "AdoScript" CREATE_OUTPUT_WIN winid:"EVENTLOG" title:"Event Logging"<br /><span class="code-lines"> 3</span><br /><span class="code-lines"> 4</span># establish a global procedure as a helper implementation for timestamped logging<br /><span class="code-lines"> 5</span>PROCEDURE global EVENT_LOG msgType:string message:string {<br /><span class="code-lines"> 6</span> CC "Application" GET_DATE_TIME<br /><span class="code-lines"> 7</span> date-format:"dd/mm/yyyy" time-format:"hh:mm:ss"<br /><span class="code-lines"> 8</span> SET currentDateTime: ((date) + " " + (time))<br /><span class="code-lines"> 9</span> CC "AdoScript" OUT winid:"EVENTLOG" text: ("[" + (msgType) + "@" + currentDateTime + "]: " + (message) + "\n")<br /><span class="code-lines">10</span>}<br /></div><br />To add a statement in the new window, use:<div class="code"><span class="code-lines">1</span># Initial event log message for the "AppInitialized" event<br /><span class="code-lines">2</span>EVENT_LOG msgType:"EVENT_LOG" message: ("AppInitialized")<br /></div><br /><br /><br />The implementation of all cases is packaged in the attached ZIP file, the library can be accessed through the ABL file. Make sure to correct the script paths in the "External coupling" library attribute. As XML files, any XML file can be used.<br /><br /><br /><strong><span style="font-size: 12px"></span>1) ONLY parsing pointers and reading content into ADOxx as String</strong><br /><span style="font-size: 12px"></span>-> less than 1 second, see console output below <br />[EVENT_LOG@19/12/2013 16:22:02]: Start parse and read of model content<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:22:02]: End parse and read of model content<br /><br /><strong><span style="font-size: 12px"></span>2) Parsing pointers and reading content into ADOxx as String, write back to a temporary file on the local machine</strong><br /><span style="font-size: 12px"></span>-> about 1 second, see console output below<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:23:32]: Start parse and read of model content<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:23:33]: End parse and read of model content<br /><br /><strong><span style="font-size: 12px"></span>3) Parsing pointers and reading content into ADOxx as String, write back to a temporary file</strong><strong><span style="font-size: 12px"></span>, perform an XSL transformation</strong><br /><span style="font-size: 12px"></span>-> 1min and 20secs, see console output below<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:24:10]: Start parse and read of model content<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:25:30]: End parse and read of model content<br /><br /><strong><span style="font-size: 12px"></span>4) Parsing pointers and reading content into ADOxx as String, write back to a temporary file, perform an XSL transformation, store transformation results in ADOxx</strong><br /><span style="font-size: 12px"></span>-> 1min and 21secs, see console output below<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:26:26]: Start parse and read of model content<br /><span style="font-size: 12px"></span>[EVENT_LOG@19/12/2013 16:27:47]: End parse and read of model content<br /><br />From the analysis above, we do assume that the transformation step is problematic, meaning the external call to the XML parser/transformer.Wilfrid Utz2014-03-18T10:06:31ZThread moved to KIT categoryWilfrid Utzhttps://www.adoxx.org/live/en_GB/c/message_boards/find_message?p_l_id=&messageId=895002014-03-18T10:00:15Z2014-03-18T10:00:15ZThread moved to KIT categoryWilfrid Utz2014-03-18T10:00:15ZRE: Script Execution TimeWilfrid Utzhttps://www.adoxx.org/live/en_GB/c/message_boards/find_message?p_l_id=&messageId=893062014-03-18T09:18:18Z2014-03-18T09:16:55ZThe getTickCount() function of AdoScript can be used, that returns the number of milliseconds that have elapsed since the system was started. An example to run a comparison could look like that:<br /><br /><div class="code"><span class="code-lines">1</span>SET t1: (getTickCount())<br /><span class="code-lines">2</span># ... actual script that performs something<br /><span class="code-lines">3</span>SET t2: (getTickCount())<br /><span class="code-lines">4</span># make it to secs<br /><span class="code-lines">5</span>SET sec: ((t2 - t1) * 0.001)<br /><span class="code-lines">6</span>CC "AdoScript" INFOBOX ("The computation took " + STR sec + " seconds.")<br /></div>Wilfrid Utz2014-03-18T09:16:55ZScript Execution Timehttps://www.adoxx.org/live/en_GB/c/message_boards/find_message?p_l_id=&messageId=893012014-03-27T11:36:12Z2014-03-18T09:15:17ZWe would like to sum up the time to get the durations for different parts of the script. Is there a way to cast the resulting time values to double/integer like it is possible to get it as a String with "as-string"?2014-03-18T09:15:17ZStoring attribute values in DB and retrieving themGleb Gawriljukhttps://www.adoxx.org/live/en_GB/c/message_boards/find_message?p_l_id=&messageId=546702014-03-27T11:35:53Z2013-12-19T08:15:55ZHey together,<br /><span style="font-size: 12px"><span style="color: #222222"><span style="font-family: arial">we have a class Object Store with the attribute XML documents: ObjStoreClass.jpg<br />The attribute XML Documents is a Table Record attribute and currently stores directory paths to XML files located on the VM. Instances of Object Store can contain different numbers of XML Documents entries: ObjStoreInstanceNotebook.jpg</span></span><span style="color: #222222"><span style="font-family: arial"><br />Our script searches through these lists of RECORD TABLE entries and retrieves the XML files several times which slows down the script (we assume). What we would like to do is store the XML files directly in an database table and access them directly, e.g. a database table provided by ADOxx. So when the user would set up an Object Store he would select and XML file from the file system which would be stored somehow in the database. When the script runs he accesses the database and gets teh XML file directly from there.<br />Is this somehow possible to realize.</span></span></span>Gleb Gawriljuk2013-12-19T08:15:55Z