/trunk/wpj/README.md |
---|
86,17 → 86,31 |
b = GetXYZ(); |
Attention! Some optimizations break the code |
-------------------------------------------- |
Performance |
----------- |
Don't choose "Fastest possible code (-otexan)" for optimization! |
### In Comparison to Filter Factory, the WPJ build without "-s" (Disable stack depth checking) is super slow! |
As soon as "Disable stack depth checking" is enabled, the code crashes |
on some combinations of machines and Photoshop versions. |
Example: |
Win98 VM + Photoshop 3.0.x: Clicking any button (Make, Load, Cancel) will cause SegFault. |
Win10 PC + Photoshop 3.0.x: No problem. |
Picture 5412x3962 pixels RGBA without transparency |
R: put(rnd(i,255),0),get(0)>255-i+val(0,-128,128)?255:0 |
G: get(0)>255-i+val(0,-128,128)?255:0 |
B: get(0)>255-i+val(0,-128,128)?255:0 |
A: a |
Approximate measurements: |
Filter Factory: 1,8 seconds |
Foundry VC++ Debug: 20 seconds |
Foundry WPJ Optimized: 18 seconds |
Foundry WPJ "-s" opt.: 3,2 seconds |
Foundry Vc++ Release: 2,8 seconds |
Foundry WingW Release: 2,8 seconds |
### What does "Fastest possible code (-otexan)" mean? |
"otexan" contains "s" (because "ox" is equal to "obmiler" and "s"). |
So, "-otexan" means: |
109,18 → 123,14 |
- Expand function in-line (-oe) |
- Disable stack depth checking (-s) |
The program works if "-ot" is enabled and all other optimizations (except "s") are enabled. |
### Attention! Some optimizations break the code: |
However, for now we just use the optimizations which "-otaxan" contains, except "s", |
so we enabled: |
As soon as "Disable stack depth checking" is enabled, the code crashes |
on some combinations of machines and Photoshop versions. |
- Time optimizations (-ot) |
- Branch prediction (-ob) |
- Loop optimizations (-ol) |
- In-line intrinsic functions (-oi) |
- Instruction scheduling (-or) |
- Math optimizations (-om) |
- Expand function in-line (-oe) |
Win98 VM + Photoshop 3.0.x: Clicking any button (Make, Load, Cancel) will cause SegFault. |
Win98 VM + Photoshop 7.0 : No problem |
Win10 PC + Photoshop 3.0.x: No problem. |
I haven't been able to detect why/where the stack is overloaded. |
If anyone has an idea, please contact me. |
130,7 → 140,9 |
https://open-watcom.github.io/open-watcom-v2-wikidocs/c_readme.html |
http://www.azillionmonkeys.com/qed/watfaq.shtml (Q19) |
However, if we add `-sg` (generate calls to grow the stack), it seems to work. |
Remarks |
------- |
140,3 → 152,8 |
Therefore the output files of bison and lex are renamed. |
There is no error checking done. |
Probably it would be better to write a small wmake file for this purpose. |
C-switches which are not recognized by the OpenWatcom IDE: |
-aq turn off qualifier mismatch warning for const/volatile |
-sg generate calls to grow the stack |
/trunk/wpj/filterfoundry.tgt |
---|
101,7 → 101,7 |
COBJ |
25 |
WVList |
20 |
14 |
26 |
MVState |
27 |
183,8 → 183,8 |
1 |
46 |
WString |
3 |
-aq |
7 |
-aq -sg |
47 |
MRState |
206,12 → 206,12 |
WCC |
52 |
WString |
23 |
?????Time optimizations |
26 |
?????Fastest possible code |
1 |
1 |
53 |
MCState |
MRState |
54 |
WString |
3 |
218,12 → 218,12 |
WCC |
55 |
WString |
22 |
?????Branch prediction |
29 |
?????No debugging information |
1 |
1 |
56 |
MCState |
MRState |
57 |
WString |
3 |
230,144 → 230,68 |
WCC |
58 |
WString |
23 |
?????Loop optimizations |
1 |
1 |
59 |
MCState |
60 |
WString |
3 |
WCC |
61 |
WString |
32 |
?????In-line intrinsic functions |
1 |
1 |
62 |
MCState |
63 |
WString |
3 |
WCC |
64 |
WString |
27 |
?????Instruction scheduling |
1 |
1 |
65 |
MCState |
66 |
WString |
3 |
WCC |
67 |
WString |
23 |
?????Math optimizations |
1 |
1 |
68 |
MVState |
69 |
WString |
3 |
WCC |
70 |
WString |
29 |
?????Expand function in-line: |
1 |
71 |
WString |
2 |
20 |
1 |
72 |
MRState |
73 |
WString |
3 |
WCC |
74 |
WString |
29 |
?????No debugging information |
1 |
1 |
75 |
MRState |
76 |
WString |
3 |
WCC |
77 |
WString |
24 |
?????Full debugging info |
1 |
78 |
59 |
MRState |
79 |
60 |
WString |
3 |
WCC |
80 |
61 |
WString |
21 |
?????Compiler default |
1 |
81 |
62 |
MRState |
82 |
63 |
WString |
3 |
WCC |
83 |
64 |
WString |
32 |
?????Inline Pentium instructions |
1 |
1 |
84 |
65 |
MRState |
85 |
66 |
WString |
3 |
WCC |
86 |
67 |
WString |
32 |
??2??Pentium stack-based calling |
1 |
1 |
87 |
68 |
MRState |
88 |
69 |
WString |
3 |
WCC |
89 |
70 |
WString |
39 |
??2??Pentium Pro register-based calling |
1 |
90 |
71 |
WVList |
1 |
91 |
72 |
ActionStates |
92 |
73 |
WString |
5 |
&Make |
93 |
74 |
WVList |
-1 |
374,18 → 298,18 |
1 |
1 |
94 |
75 |
MItem |
10 |
..\funcs.c |
95 |
76 |
WString |
4 |
COBJ |
96 |
77 |
WVList |
97 |
78 |
WVList |
23 |
392,18 → 316,18 |
1 |
1 |
98 |
79 |
MItem |
11 |
..\lex_yy.c |
99 |
80 |
WString |
4 |
COBJ |
100 |
81 |
WVList |
101 |
82 |
WVList |
23 |
410,18 → 334,18 |
1 |
1 |
102 |
83 |
MItem |
13 |
..\load_win.c |
103 |
84 |
WString |
4 |
COBJ |
104 |
85 |
WVList |
105 |
86 |
WVList |
23 |
428,18 → 352,18 |
1 |
1 |
106 |
87 |
MItem |
9 |
..\main.c |
107 |
88 |
WString |
4 |
COBJ |
108 |
89 |
WVList |
109 |
90 |
WVList |
23 |
446,18 → 370,18 |
1 |
1 |
110 |
91 |
MItem |
9 |
..\make.c |
111 |
92 |
WString |
4 |
COBJ |
112 |
93 |
WVList |
113 |
94 |
WVList |
23 |
464,18 → 388,18 |
1 |
1 |
114 |
95 |
MItem |
13 |
..\make_win.c |
115 |
96 |
WString |
4 |
COBJ |
116 |
97 |
WVList |
117 |
98 |
WVList |
23 |
482,18 → 406,18 |
1 |
1 |
118 |
99 |
MItem |
13 |
..\manifest.c |
119 |
100 |
WString |
4 |
COBJ |
120 |
101 |
WVList |
121 |
102 |
WVList |
23 |
500,18 → 424,18 |
1 |
1 |
122 |
103 |
MItem |
9 |
..\node.c |
123 |
104 |
WString |
4 |
COBJ |
124 |
105 |
WVList |
125 |
106 |
WVList |
23 |
518,18 → 442,18 |
1 |
1 |
126 |
107 |
MItem |
11 |
..\obfusc.c |
127 |
108 |
WString |
4 |
COBJ |
128 |
109 |
WVList |
129 |
110 |
WVList |
23 |
536,18 → 460,18 |
1 |
1 |
130 |
111 |
MItem |
12 |
..\preview.c |
131 |
112 |
WString |
4 |
COBJ |
132 |
113 |
WVList |
133 |
114 |
WVList |
23 |
554,18 → 478,18 |
1 |
1 |
134 |
115 |
MItem |
12 |
..\process.c |
135 |
116 |
WString |
4 |
COBJ |
136 |
117 |
WVList |
137 |
118 |
WVList |
23 |
572,18 → 496,18 |
1 |
1 |
138 |
119 |
MItem |
9 |
..\read.c |
139 |
120 |
WString |
4 |
COBJ |
140 |
121 |
WVList |
141 |
122 |
WVList |
23 |
590,18 → 514,18 |
1 |
1 |
142 |
123 |
MItem |
9 |
..\save.c |
143 |
124 |
WString |
4 |
COBJ |
144 |
125 |
WVList |
145 |
126 |
WVList |
23 |
608,18 → 532,18 |
1 |
1 |
146 |
127 |
MItem |
14 |
..\scripting.c |
147 |
128 |
WString |
4 |
COBJ |
148 |
129 |
WVList |
149 |
130 |
WVList |
23 |
626,18 → 550,18 |
1 |
1 |
150 |
131 |
MItem |
15 |
..\slider_win.c |
151 |
132 |
WString |
4 |
COBJ |
152 |
133 |
WVList |
153 |
134 |
WVList |
23 |
644,18 → 568,18 |
1 |
1 |
154 |
135 |
MItem |
11 |
..\symtab.c |
155 |
136 |
WString |
4 |
COBJ |
156 |
137 |
WVList |
157 |
138 |
WVList |
23 |
662,27 → 586,27 |
1 |
1 |
158 |
139 |
MItem |
44 |
..\telegraphics_common\adobeplugin\dllmain.c |
159 |
140 |
WString |
4 |
COBJ |
160 |
141 |
WVList |
161 |
142 |
WVList |
1 |
162 |
143 |
ActionStates |
163 |
144 |
WString |
5 |
&Make |
164 |
145 |
WVList |
23 |
689,18 → 613,18 |
1 |
1 |
165 |
146 |
MItem |
42 |
..\telegraphics_common\tt\choosefile_win.c |
166 |
147 |
WString |
4 |
COBJ |
167 |
148 |
WVList |
168 |
149 |
WVList |
23 |
707,18 → 631,18 |
1 |
1 |
169 |
150 |
MItem |
41 |
..\telegraphics_common\tt\compat_string.c |
170 |
151 |
WString |
4 |
COBJ |
171 |
152 |
WVList |
172 |
153 |
WVList |
23 |
725,18 → 649,18 |
1 |
1 |
173 |
154 |
MItem |
38 |
..\telegraphics_common\tt\compat_win.c |
174 |
155 |
WString |
4 |
COBJ |
175 |
156 |
WVList |
176 |
157 |
WVList |
23 |
743,18 → 667,18 |
1 |
1 |
177 |
158 |
MItem |
47 |
..\telegraphics_common\tt\compat_win_resource.c |
178 |
159 |
WString |
4 |
COBJ |
179 |
160 |
WVList |
180 |
161 |
WVList |
23 |
761,18 → 685,18 |
1 |
1 |
181 |
162 |
MItem |
35 |
..\telegraphics_common\tt\dbg_win.c |
182 |
163 |
WString |
4 |
COBJ |
183 |
164 |
WVList |
184 |
165 |
WVList |
23 |
779,18 → 703,18 |
1 |
1 |
185 |
166 |
MItem |
43 |
..\telegraphics_common\tt\file_compat_win.c |
186 |
167 |
WString |
4 |
COBJ |
187 |
168 |
WVList |
188 |
169 |
WVList |
23 |
797,18 → 721,18 |
1 |
1 |
189 |
170 |
MItem |
40 |
..\telegraphics_common\tt\sprintf_tiny.c |
190 |
171 |
WString |
4 |
COBJ |
191 |
172 |
WVList |
192 |
173 |
WVList |
23 |
815,18 → 739,18 |
1 |
1 |
193 |
174 |
MItem |
31 |
..\telegraphics_common\tt\str.c |
194 |
175 |
WString |
4 |
COBJ |
195 |
176 |
WVList |
196 |
177 |
WVList |
23 |
833,18 → 757,18 |
1 |
1 |
197 |
178 |
MItem |
41 |
..\telegraphics_common\tt\ui_compat_win.c |
198 |
179 |
WString |
4 |
COBJ |
199 |
180 |
WVList |
200 |
181 |
WVList |
23 |
851,18 → 775,18 |
1 |
1 |
201 |
182 |
MItem |
7 |
..\ui.c |
202 |
183 |
WString |
4 |
COBJ |
203 |
184 |
WVList |
204 |
185 |
WVList |
23 |
869,18 → 793,18 |
1 |
1 |
205 |
186 |
MItem |
13 |
..\ui_build.c |
206 |
187 |
WString |
4 |
COBJ |
207 |
188 |
WVList |
208 |
189 |
WVList |
23 |
887,18 → 811,18 |
1 |
1 |
209 |
190 |
MItem |
17 |
..\ui_build_win.c |
210 |
191 |
WString |
4 |
COBJ |
211 |
192 |
WVList |
212 |
193 |
WVList |
23 |
905,18 → 829,18 |
1 |
1 |
213 |
194 |
MItem |
11 |
..\ui_win.c |
214 |
195 |
WString |
4 |
COBJ |
215 |
196 |
WVList |
216 |
197 |
WVList |
23 |
923,18 → 847,18 |
1 |
1 |
217 |
198 |
MItem |
27 |
..\versioninfo_modify_win.c |
218 |
199 |
WString |
4 |
COBJ |
219 |
200 |
WVList |
220 |
201 |
WVList |
23 |
941,18 → 865,18 |
1 |
1 |
221 |
202 |
MItem |
10 |
..\y_tab.c |
222 |
203 |
WString |
4 |
COBJ |
223 |
204 |
WVList |
224 |
205 |
WVList |
23 |
959,18 → 883,18 |
1 |
1 |
225 |
206 |
MItem |
3 |
*.h |
226 |
207 |
WString |
3 |
NIL |
227 |
208 |
WVList |
228 |
209 |
WVList |
-1 |
977,734 → 901,734 |
1 |
1 |
229 |
210 |
MItem |
6 |
..\c.h |
230 |
211 |
WString |
3 |
NIL |
231 |
212 |
WVList |
232 |
213 |
WVList |
225 |
206 |
1 |
1 |
233 |
214 |
MItem |
13 |
..\cwprefix.h |
234 |
215 |
WString |
3 |
NIL |
235 |
216 |
WVList |
236 |
217 |
WVList |
225 |
206 |
1 |
1 |
237 |
218 |
MItem |
7 |
..\ff.h |
238 |
219 |
WString |
3 |
NIL |
239 |
220 |
WVList |
240 |
221 |
WVList |
225 |
206 |
1 |
1 |
241 |
222 |
MItem |
12 |
..\ff_misc.h |
242 |
223 |
WString |
3 |
NIL |
243 |
224 |
WVList |
244 |
225 |
WVList |
225 |
206 |
1 |
1 |
245 |
226 |
MItem |
10 |
..\funcs.h |
246 |
227 |
WString |
3 |
NIL |
247 |
228 |
WVList |
248 |
229 |
WVList |
225 |
206 |
1 |
1 |
249 |
230 |
MItem |
13 |
..\manifest.h |
250 |
231 |
WString |
3 |
NIL |
251 |
232 |
WVList |
252 |
233 |
WVList |
225 |
206 |
1 |
1 |
253 |
234 |
MItem |
9 |
..\node.h |
254 |
235 |
WString |
3 |
NIL |
255 |
236 |
WVList |
256 |
237 |
WVList |
225 |
206 |
1 |
1 |
257 |
238 |
MItem |
9 |
..\PARM.h |
258 |
239 |
WString |
3 |
NIL |
259 |
240 |
WVList |
260 |
241 |
WVList |
225 |
206 |
1 |
1 |
261 |
242 |
MItem |
12 |
..\preview.h |
262 |
243 |
WString |
3 |
NIL |
263 |
244 |
WVList |
264 |
245 |
WVList |
225 |
206 |
1 |
1 |
265 |
246 |
MItem |
14 |
..\scripting.h |
266 |
247 |
WString |
3 |
NIL |
267 |
248 |
WVList |
268 |
249 |
WVList |
225 |
206 |
1 |
1 |
269 |
250 |
MItem |
15 |
..\slider_win.h |
270 |
251 |
WString |
3 |
NIL |
271 |
252 |
WVList |
272 |
253 |
WVList |
225 |
206 |
1 |
1 |
273 |
254 |
MItem |
11 |
..\symtab.h |
274 |
255 |
WString |
3 |
NIL |
275 |
256 |
WVList |
276 |
257 |
WVList |
225 |
206 |
1 |
1 |
277 |
258 |
MItem |
44 |
..\telegraphics_common\adobeplugin\A4Stuff.h |
278 |
259 |
WString |
3 |
NIL |
279 |
260 |
WVList |
280 |
261 |
WVList |
225 |
206 |
1 |
1 |
281 |
262 |
MItem |
42 |
..\telegraphics_common\adobeplugin\entry.h |
282 |
263 |
WString |
3 |
NIL |
283 |
264 |
WVList |
284 |
265 |
WVList |
225 |
206 |
1 |
1 |
285 |
266 |
MItem |
42 |
..\telegraphics_common\adobeplugin\world.h |
286 |
267 |
WString |
3 |
NIL |
287 |
268 |
WVList |
288 |
269 |
WVList |
225 |
206 |
1 |
1 |
289 |
270 |
MItem |
42 |
..\telegraphics_common\tt\calc_std_state.h |
290 |
271 |
WString |
3 |
NIL |
291 |
272 |
WVList |
292 |
273 |
WVList |
225 |
206 |
1 |
1 |
293 |
274 |
MItem |
39 |
..\telegraphics_common\tt\carbonstuff.h |
294 |
275 |
WString |
3 |
NIL |
295 |
276 |
WVList |
296 |
277 |
WVList |
225 |
206 |
1 |
1 |
297 |
278 |
MItem |
38 |
..\telegraphics_common\tt\choosefile.h |
298 |
279 |
WString |
3 |
NIL |
299 |
280 |
WVList |
300 |
281 |
WVList |
225 |
206 |
1 |
1 |
301 |
282 |
MItem |
41 |
..\telegraphics_common\tt\compat_string.h |
302 |
283 |
WString |
3 |
NIL |
303 |
284 |
WVList |
304 |
285 |
WVList |
225 |
206 |
1 |
1 |
305 |
286 |
MItem |
38 |
..\telegraphics_common\tt\compat_win.h |
306 |
287 |
WString |
3 |
NIL |
307 |
288 |
WVList |
308 |
289 |
WVList |
225 |
206 |
1 |
1 |
309 |
290 |
MItem |
47 |
..\telegraphics_common\tt\compat_win_resource.h |
310 |
291 |
WString |
3 |
NIL |
311 |
292 |
WVList |
312 |
293 |
WVList |
225 |
206 |
1 |
1 |
313 |
294 |
MItem |
31 |
..\telegraphics_common\tt\dbg.h |
314 |
295 |
WString |
3 |
NIL |
315 |
296 |
WVList |
316 |
297 |
WVList |
225 |
206 |
1 |
1 |
317 |
298 |
MItem |
31 |
..\telegraphics_common\tt\dlg.h |
318 |
299 |
WString |
3 |
NIL |
319 |
300 |
WVList |
320 |
301 |
WVList |
225 |
206 |
1 |
1 |
321 |
302 |
MItem |
39 |
..\telegraphics_common\tt\file_compat.h |
322 |
303 |
WString |
3 |
NIL |
323 |
304 |
WVList |
324 |
305 |
WVList |
225 |
206 |
1 |
1 |
325 |
306 |
MItem |
32 |
..\telegraphics_common\tt\menu.h |
326 |
307 |
WString |
3 |
NIL |
327 |
308 |
WVList |
328 |
309 |
WVList |
225 |
206 |
1 |
1 |
329 |
310 |
MItem |
36 |
..\telegraphics_common\tt\misc-mac.h |
330 |
311 |
WString |
3 |
NIL |
331 |
312 |
WVList |
332 |
313 |
WVList |
225 |
206 |
1 |
1 |
333 |
314 |
MItem |
32 |
..\telegraphics_common\tt\misc.h |
334 |
315 |
WString |
3 |
NIL |
335 |
316 |
WVList |
336 |
317 |
WVList |
225 |
206 |
1 |
1 |
337 |
318 |
MItem |
30 |
..\telegraphics_common\tt\qd.h |
338 |
319 |
WString |
3 |
NIL |
339 |
320 |
WVList |
340 |
321 |
WVList |
225 |
206 |
1 |
1 |
341 |
322 |
MItem |
34 |
..\telegraphics_common\tt\scroll.h |
342 |
323 |
WString |
3 |
NIL |
343 |
324 |
WVList |
344 |
325 |
WVList |
225 |
206 |
1 |
1 |
345 |
326 |
MItem |
40 |
..\telegraphics_common\tt\sprintf_tiny.h |
346 |
327 |
WString |
3 |
NIL |
347 |
328 |
WVList |
348 |
329 |
WVList |
225 |
206 |
1 |
1 |
349 |
330 |
MItem |
31 |
..\telegraphics_common\tt\str.h |
350 |
331 |
WString |
3 |
NIL |
351 |
332 |
WVList |
352 |
333 |
WVList |
225 |
206 |
1 |
1 |
353 |
334 |
MItem |
37 |
..\telegraphics_common\tt\ui_compat.h |
354 |
335 |
WString |
3 |
NIL |
355 |
336 |
WVList |
356 |
337 |
WVList |
225 |
206 |
1 |
1 |
357 |
338 |
MItem |
32 |
..\telegraphics_common\tt\wind.h |
358 |
339 |
WString |
3 |
NIL |
359 |
340 |
WVList |
360 |
341 |
WVList |
225 |
206 |
1 |
1 |
361 |
342 |
MItem |
7 |
..\ui.h |
362 |
343 |
WString |
3 |
NIL |
363 |
344 |
WVList |
364 |
345 |
WVList |
225 |
206 |
1 |
1 |
365 |
346 |
MItem |
11 |
..\unistd.h |
366 |
347 |
WString |
3 |
NIL |
367 |
348 |
WVList |
368 |
349 |
WVList |
225 |
206 |
1 |
1 |
369 |
350 |
MItem |
12 |
..\version.h |
370 |
351 |
WString |
3 |
NIL |
371 |
352 |
WVList |
372 |
353 |
WVList |
225 |
206 |
1 |
1 |
373 |
354 |
MItem |
27 |
..\versioninfo_modify_win.h |
374 |
355 |
WString |
3 |
NIL |
375 |
356 |
WVList |
376 |
357 |
WVList |
225 |
206 |
1 |
1 |
377 |
358 |
MItem |
10 |
..\y.tab.h |
378 |
359 |
WString |
3 |
NIL |
379 |
360 |
WVList |
380 |
361 |
WVList |
225 |
206 |
1 |
1 |
381 |
362 |
MItem |
4 |
*.rc |
382 |
363 |
WString |
5 |
NRESC |
383 |
364 |
WVList |
2 |
384 |
365 |
MVState |
385 |
366 |
WString |
3 |
WRC |
386 |
367 |
WString |
23 |
n????Macro definitions: |
1 |
387 |
368 |
WString |
61 |
WIN32 _WIN32 __NT__ WIN_ENV=1 INSIDE_PHOTOSHOP=1 MSWindows=1 |
388 |
369 |
MVState |
389 |
370 |
WString |
3 |
WRC |
390 |
371 |
WString |
25 |
n????Include directories: |
1 |
391 |
372 |
WString |
73 |
$[:;$(%watcom)\h;$(%watcom)\h\nt;$(%PSAPI)\Photoshop;$(%PSAPI)\Pica_sp;.\ |
392 |
373 |
WVList |
-1 |
1711,21 → 1635,21 |
1 |
1 |
393 |
374 |
MItem |
13 |
..\win_res.rc |
394 |
375 |
WString |
5 |
NRESC |
395 |
376 |
WVList |
396 |
377 |
WVList |
381 |
362 |
1 |
1 |