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