File: thread_count.ScalePoints.py

package info (click to toggle)
k3d 0.8.0.2-6
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 40,692 kB
  • ctags: 39,695
  • sloc: cpp: 171,303; ansic: 24,129; xml: 6,995; python: 5,796; makefile: 726; sh: 22
file content (27 lines) | stat: -rw-r--r-- 767 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#python

import k3d
import testing

# Create a mesh source and our test modifier ...
setup = testing.setup_mesh_modifier_test("PolyGrid", "ScalePoints")
setup.source.rows = 300
setup.source.columns = 300

selection = k3d.geometry.selection.create(0)
selection.points = k3d.geometry.point_selection.create(selection, 1)
setup.modifier.mesh_selection = selection

# Force an update of the mesh source output, so it doesn't interfere with our timing
mesh = setup.source.output_mesh

for thread_count in range(1, 9):
	k3d.parallel.set_grain_size(10000)
	k3d.parallel.set_thread_count(thread_count)
	setup.modifier.x = 1.0
	setup.modifier.x = 2.0

	timer = testing.timer()
	mesh = setup.modifier.output_mesh
	print "Thread Count:", thread_count, "Time:", timer.elapsed()