Rev 440 | Rev 526 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 440 | Rev 452 | ||
---|---|---|---|
Line 84... | Line 84... | ||
84 | int b; |
84 | int b; |
85 | int c; |
85 | int c; |
86 | b = GetXYZ(); |
86 | b = GetXYZ(); |
87 | 87 | ||
88 | 88 | ||
89 | Attention! Some optimizations break the code |
89 | Performance |
90 | -------------------------------------------- |
90 | ----------- |
91 | 91 | ||
92 | Don't choose "Fastest possible code (-otexan)" for optimization! |
92 | ### In Comparison to Filter Factory, the WPJ build without "-s" (Disable stack depth checking) is super slow! |
93 | 93 | ||
94 | As soon as "Disable stack depth checking" is enabled, the code crashes |
- | |
95 | on some combinations of machines and Photoshop versions. |
94 | Example: |
96 | 95 | ||
- | 96 | Picture 5412x3962 pixels RGBA without transparency |
|
- | 97 | ||
97 | Win98 VM + Photoshop 3.0.x: Clicking any button (Make, Load, Cancel) will cause SegFault. |
98 | R: put(rnd(i,255),0),get(0)>255-i+val(0,-128,128)?255:0 |
- | 99 | G: get(0)>255-i+val(0,-128,128)?255:0 |
|
- | 100 | B: get(0)>255-i+val(0,-128,128)?255:0 |
|
- | 101 | A: a |
|
- | 102 | ||
- | 103 | Approximate measurements: |
|
- | 104 | ||
- | 105 | Filter Factory: 1,8 seconds |
|
- | 106 | Foundry VC++ Debug: 20 seconds |
|
- | 107 | Foundry WPJ Optimized: 18 seconds |
|
98 | Win10 PC + Photoshop 3.0.x: No problem. |
108 | Foundry WPJ "-s" opt.: 3,2 seconds |
- | 109 | Foundry Vc++ Release: 2,8 seconds |
|
- | 110 | Foundry WingW Release: 2,8 seconds |
|
- | 111 | ||
- | 112 | ### What does "Fastest possible code (-otexan)" mean? |
|
99 | 113 | ||
100 | "otexan" contains "s" (because "ox" is equal to "obmiler" and "s"). |
114 | "otexan" contains "s" (because "ox" is equal to "obmiler" and "s"). |
101 | 115 | ||
102 | So, "-otexan" means: |
116 | So, "-otexan" means: |
103 | 117 | ||
Line 107... | Line 121... | ||
107 | - Instruction scheduling (-or) |
121 | - Instruction scheduling (-or) |
108 | - Math optimizations (-om) |
122 | - Math optimizations (-om) |
109 | - Expand function in-line (-oe) |
123 | - Expand function in-line (-oe) |
110 | - Disable stack depth checking (-s) |
124 | - Disable stack depth checking (-s) |
111 | 125 | ||
112 | The program works if "-ot" is enabled and all other optimizations (except "s") are enabled. |
126 | ### Attention! Some optimizations break the code: |
113 | 127 | ||
114 | However, for now we just use the optimizations which "-otaxan" contains, except "s", |
128 | As soon as "Disable stack depth checking" is enabled, the code crashes |
115 | so we enabled: |
129 | on some combinations of machines and Photoshop versions. |
116 | 130 | ||
117 | - Time optimizations (-ot) |
- | |
118 | - Branch prediction (-ob) |
- | |
119 | - Loop optimizations (-ol) |
- | |
120 | - In-line intrinsic functions (-oi) |
131 | Win98 VM + Photoshop 3.0.x: Clicking any button (Make, Load, Cancel) will cause SegFault. |
121 | - Instruction scheduling (-or) |
- | |
122 | - Math optimizations (-om) |
132 | Win98 VM + Photoshop 7.0 : No problem |
123 | - Expand function in-line (-oe) |
133 | Win10 PC + Photoshop 3.0.x: No problem. |
124 | 134 | ||
125 | I haven't been able to detect why/where the stack is overloaded. |
135 | I haven't been able to detect why/where the stack is overloaded. |
126 | If anyone has an idea, please contact me. |
136 | If anyone has an idea, please contact me. |
127 | Maybe the initial stack size is just too small? |
137 | Maybe the initial stack size is just too small? |
128 | Because the code should be OK - Application Verifier has not detected anything wrong. |
138 | Because the code should be OK - Application Verifier has not detected anything wrong. |
129 | 139 | ||
130 | https://open-watcom.github.io/open-watcom-v2-wikidocs/c_readme.html |
140 | https://open-watcom.github.io/open-watcom-v2-wikidocs/c_readme.html |
131 | http://www.azillionmonkeys.com/qed/watfaq.shtml (Q19) |
141 | http://www.azillionmonkeys.com/qed/watfaq.shtml (Q19) |
132 | 142 | ||
- | 143 | However, if we add `-sg` (generate calls to grow the stack), it seems to work. |
|
- | 144 | ||
133 | 145 | ||
134 | Remarks |
146 | Remarks |
135 | ------- |
147 | ------- |
136 | 148 | ||
137 | flex and bison are currently invoked as a batch process. |
149 | flex and bison are currently invoked as a batch process. |
138 | This is defined in the menu File->Before. |
150 | This is defined in the menu File->Before. |
139 | The IDE fails to build the project when filenames contain more than one dot. |
151 | The IDE fails to build the project when filenames contain more than one dot. |
140 | Therefore the output files of bison and lex are renamed. |
152 | Therefore the output files of bison and lex are renamed. |
141 | There is no error checking done. |
153 | There is no error checking done. |
142 | Probably it would be better to write a small wmake file for this purpose. |
154 | Probably it would be better to write a small wmake file for this purpose. |
- | 155 | ||
- | 156 | C-switches which are not recognized by the OpenWatcom IDE: |
|
- | 157 | ||
- | 158 | -aq turn off qualifier mismatch warning for const/volatile |
|
- | 159 | -sg generate calls to grow the stack |