dbab9c53 |
1 | puts "===========" |
2 | puts "0031748: Application Framework - Efficient OCAF transactions in OCCT" |
3 | puts "===========" |
4 | |
5 | NewDocument D |
6 | UndoLimit D 10 |
7 | |
8 | # number of labels of objects in the document |
9 | set labs 100000 |
10 | # number of sub-labels of each object |
11 | set sublabs 10 |
12 | |
13 | NewCommand D |
14 | |
15 | # store at each object-label sub-labels with two attributes at each |
16 | set creation_time [lindex [time { |
17 | for {set i 1} {$i <= $labs} {incr i} { |
18 | set lab [Label D 0:1:${i}] |
19 | SetName D ${lab} Object$i |
20 | for {set ii 1} {$ii <= $sublabs} {incr ii} { |
21 | set sublab [Label D ${lab}:$ii] |
22 | SetInteger D ${sublab} 10 |
23 | SetReal D ${sublab} 12.3 |
24 | } |
25 | } |
26 | }] 0] |
27 | |
28 | set commit_time [lindex [time { |
29 | CommitCommand D |
30 | }] 0] |
31 | |
32 | # modify only one object one attribute |
33 | NewCommand D |
34 | set one_modif_time [lindex [time { |
35 | SetInteger D 0:1:[expr $labs/2]:[expr $sublabs/2] 20 |
36 | }] 0] |
37 | |
38 | set one_commit_time [lindex [time { |
39 | CommitCommand D |
40 | }] 0] |
41 | |
42 | puts "Tree creation time $creation_time mcs" |
43 | puts "Creation commit time $commit_time mcs" |
44 | puts "One attribute modification time $one_modif_time mcs" |
45 | puts "Commit of single modification time $one_commit_time mcs" |
46 | |
47 | if {$creation_time > $commit_time} { |
48 | set max_creation $creation_time |
49 | } else { |
50 | set max_creation $commit_time |
51 | } |
52 | |
53 | # Check that creation time (or commit) is at least 1000 times slower than commit of one modification (normally 4000). |
54 | # Before the optimization it was only 150 times slower. |
55 | if { [expr $max_creation/1000.] < $one_commit_time } { |
56 | puts "Error : one modification time commit is too big relatively to the whole document creation or commit" |
57 | } |