SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

research:cultivate:prologperformance [2018/05/09 01:59] (current)
Line 1: Line 1:
 +
 +==== What is important ====
 +
 +  * bound vs. not bound variables (always keep in mind if a variable is bound or not)
 +  * accessing the first argument works in linear time (first-argument-indexing)
 +  * use _In and _InEncl : see [[pefsuffixes]]
 +==== Example ====
 +
 +=== Find all methods in a Class ===
 +
 +=== bound vs. non-bound variables ===
 +
 +  * what is bound: ClassID
 +  * what is probably not bound: MethodID
 +=== good choice: use first argument indexing (remember: ClassID is bound) with methodDefT_In ===
 +<​Code>​
 +  methodDefT_In(ClassID,​ MethodID)</​Code>​
 +=== bad choice: use methodDefT (remember: MethodID is probably not bound): ===
 +<​Code>​
 +  methodDefT(MethodID,​ ClassID, _, _, _, _, _)</​Code>​
 +=== running time ===
 +
 +
 +Assumptions
 +
 +
 +  * ''​c''​ classes
 +  * ''​m''​ methods
 +  * ''​n''​ methods in the class with ClassID
 +  * first argument access works in constant time 
 +  * other access in linear time (or logarithmic if you explicitly create an index)
 +
 +Result
 +
 +
 +  * using methodDefT_In takes time ''​n''​
 +  * using methodDefT takes time ''​m''​
 +
 +Assuming we have ''​c=100''​ classes with the same number of methods ''​n''​ each, using methodDefT_In is ''​m/​n = 100n/n = 100''​ times faster than using methodDefT.
 +
  
research/cultivate/prologperformance.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019