/[libvob]/libvob/bench/mark.py
ViewVC logotype

Diff of /libvob/bench/mark.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by tjl, Fri Apr 4 12:34:59 2003 UTC revision 1.5 by tjl, Mon Apr 14 04:46:28 2003 UTC
# Line 4  Line 4 
4    
5  """  """
6    
7    
8    import sys
9    sys.path.insert(0, ".")
10    import vob
11    
12  import sys, types, traceback  import sys, types, traceback
13    
14  import java  import java
15    
 from org.nongnu import libvob as vob  
   
16  def dict(d):  def dict(d):
17      n = {}      n = {}
18      for k in d.keys():      for k in d.keys():
# Line 47  def run(sceneFunc, args): Line 50  def run(sceneFunc, args):
50      win = vob.GraphicsAPI.getInstance().createWindow()      win = vob.GraphicsAPI.getInstance().createWindow()
51      win.setLocation(0, 0, 1024, 768)      win.setLocation(0, 0, 1024, 768)
52    
53        sx = 0
54        while sx < 1024:
55            vs = win.createVobScene()
56            sx = vs.size.width
57    
58    
59      for ar in _argLists(args):      for ar in _argLists(args):
60          vs = win.createVobScene()          vs = win.createVobScene()
61          sceneFunc(vs, **ar)          ou = sceneFunc(vs, **ar)
62          print ar          print ar
63          total = 0          total = 0
64          iters = 1          iters = 1
# Line 59  def run(sceneFunc, args): Line 67  def run(sceneFunc, args):
67              total = win.timeRender(vs, 1, iters)              total = win.timeRender(vs, 1, iters)
68              ms = total / iters * 1000              ms = total / iters * 1000
69              # print "Now: ",iters,total,ms              # print "Now: ",iters,total,ms
70            print ou
71          print ms, "ms   with ",iters," in ",total,"\n"          print ms, "ms   with ",iters," in ",total,"\n"
72    
73  if __name__ == "__main__":  if __name__ == "__main__":
     sys.path.insert(0, ".")  
74      import getopt      import getopt
75      opts, args = getopt.getopt(sys.argv[1:],      opts, args = getopt.getopt(sys.argv[1:],
76              vob.util.dbg.short,              vob.util.dbg.short,
# Line 74  if __name__ == "__main__": Line 82  if __name__ == "__main__":
82      # testmod = "bench.vob.text.overhead"      # testmod = "bench.vob.text.overhead"
83      # testmod = "bench.vob.paper.dice"      # testmod = "bench.vob.paper.dice"
84      # testmod = "bench.vob.trans.trivial"      # testmod = "bench.vob.trans.trivial"
85      testmod = "bench.vob."+args[0]      testmod = args[0]
     exec "import "+testmod+"\ntestmod = "+testmod+"\n"  
   
86      print "TESTMOD: ",testmod      print "TESTMOD: ",testmod
87    
88    
89    
90      class Starter(java.lang.Runnable):      class Starter(java.lang.Runnable):
91          def run(self):          def run(self):
92                exec "import "+testmod+"\ntestmod = "+testmod+"\n"
93              try:              try:
94                  run(testmod.benchScene, testmod.args)                  run(testmod.benchScene, testmod.args)
95              except:              except:

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26