Fix for 687521, Very slow .bindnow operator

Alex Cherepanov <[email protected]> Thu, 17 Jun 2004 19:13:21 -0400
Newsgroups gmane.comp.printing.ghostscript.patches
Organization Coscript Software
Message-ID <[email protected]>
Disable idiom recognition feature during execution of .bindnow
because it has no effect except burning a few seconds of CPU time.
Fix bug 687519

_______________________________________________
gs-code-review mailing list
[email protected]
http://www.ghostscript.com/mailman/listinfo/gs-code-review
gs_init.ps.diff (text/plain, 1018 B)
Index: gs/lib/gs_init.ps
===================================================================
RCS file: /cvs/ghostscript/gs/lib/gs_init.ps,v
retrieving revision 1.106
diff -b -u -r1.106 gs_init.ps
--- gs/lib/gs_init.ps	23 Mar 2004 12:30:40 -0000	1.106
+++ gs/lib/gs_init.ps	17 Jun 2004 22:50:40 -0000
@@ -1923,6 +1924,9 @@
 
 % If we delayed binding, make it possible to do it later.
 /.bindnow {
+  currentuserparams /IdiomRecognition .knownget {
+    1 dict dup /IdiomRecognition //false put setuserparams
+  } if
   //systemdict begin .bindoperators end
   % Temporarily disable the typecheck error.
   errordict /typecheck 2 copy get
@@ -1934,6 +1938,9 @@
   //systemdict /.forcedef .forceundef		% remove temptation
   //systemdict /.forceput .forceundef		% ditto
   //systemdict /.forceundef .forceundef		% ditto
+  currentuserparams /IdiomRecognition known {
+    1 dict dup /IdiomRecognition 4 -1 roll put setuserparams
+  } if
 } .bind odef
 
 % Turn off array packing, since some PostScript code assumes that