From cmucl-devel at common-lisp.net Fri May 17 02:36:29 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Fri, 17 May 2013 02:36:29 -0000 Subject: [cmucl] #82: Source location error on large files Message-ID: <052.57351d513289904a4f9d10969b65000a@common-lisp.net> #82: Source location error on large files --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2013-05 Keywords: | --------------------+------------------------------------------------------- As noted in the [http://article.gmane.org/gmane.lisp.cmucl.general/6497 email from Matt Kaufmann], there is an error in computing the source location. The problem was that the file was very large with many long forms. This caused the form number to overflow the 14-bit number used to hold the form number. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Sun May 19 00:39:08 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Sun, 19 May 2013 00:39:08 -0000 Subject: [cmucl] #81: Reversing a string is slow In-Reply-To: <052.0e7c607d156cb27f17c6f5db91f5715e@common-lisp.net> References: <052.0e7c607d156cb27f17c6f5db91f5715e@common-lisp.net> Message-ID: <061.4aca1bef3fea2776a8d173b2e699f1f0@common-lisp.net> #81: Reversing a string is slow --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2013-05 Keywords: | --------------------+------------------------------------------------------- Comment(by rtoy): Here is another test, with surrogate pairs: {{{ (defparameter *s2* (lisp::codepoints-string (loop for k from 0 below 1000000 collect (+ 65536 k)))) (time (prog1 t (time-rev *s2*))) ; Compiling LAMBDA NIL: ; Compiling Top-Level Form: ; Evaluation took: ; 10.08 seconds of real time ; 10.050677 seconds of user run time ; 0.017808 seconds of system run time ; 30,831,596,637 CPU cycles ; [Run times include 0.14 seconds GC run time] ; 0 page faults and ; 400,215,072 bytes consed. }}} Although the string is twice as long (because of the surrogates), the time is the same. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Tue May 21 02:25:04 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Tue, 21 May 2013 02:25:04 -0000 Subject: [cmucl] #82: Source location error on large files In-Reply-To: <052.57351d513289904a4f9d10969b65000a@common-lisp.net> References: <052.57351d513289904a4f9d10969b65000a@common-lisp.net> Message-ID: <061.9763726a7f908643ac1c741c8ed013fa@common-lisp.net> #82: Source location error on large files ---------------------+------------------------------------------------------ Reporter: rtoy | Owner: somebody Type: defect | Status: closed Priority: major | Milestone: Component: Core | Version: 2013-05 Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by toy.raymond@?): * status: new => closed * resolution: => fixed Comment: commit 9be6530c85baf6d45ab60a94867ba1e3ff3d66b0 Author: Raymond Toy Date: Mon May 20 19:24:53 2013 -0700 Fix ticket:82: If the form numbers are too large to be encoded, don't try to set the source location information. We try to print a warning in such cases. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Sun May 19 00:47:54 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Sun, 19 May 2013 00:47:54 -0000 Subject: [cmucl] #83: (reverse "") signals an error In-Reply-To: <052.5d0b9e6fa5f1d91184343a7d1de9bbc8@common-lisp.net> References: <052.5d0b9e6fa5f1d91184343a7d1de9bbc8@common-lisp.net> Message-ID: <061.e8406a340d009ac9c03d66bb1f06fa52@common-lisp.net> #83: (reverse "") signals an error ---------------------+------------------------------------------------------ Reporter: rtoy | Owner: somebody Type: defect | Status: closed Priority: major | Milestone: Component: Core | Version: 2013-05 Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by toy.raymond@?): * status: new => closed * resolution: => fixed Comment: commit 78cce51df441b220c071024fb5e616f1928184dd Author: Raymond Toy Date: Sat May 18 17:44:02 2013 -0700 Fix ticket:81 and fix ticket:83. From ticket 81, the tests are now: {{{ (time (prog1 t (time-rev *s*))) ; Evaluation took: ; 0.49 seconds of real time ; 0.481813 seconds of user run time ; 0.003624 seconds of system run time ; 1,490,776,936 CPU cycles ; [Run times include 0.13 seconds GC run time] ; 0 page faults and ; 200,073,704 bytes consed. (time (prog1 t (time-rev *s2*))) ; Evaluation took: ; 0.97 seconds of real time ; 0.965893 seconds of user run time ; 0.005139 seconds of system run time ; 2,980,415,911 CPU cycles ; [Run times include 0.23 seconds GC run time] ; 0 page faults and ; 400,005,560 bytes consed. }}} So the new string-reverse* is 20 times faster for strings without surrogates and 10 times faster for strings containing only surrogates. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Wed May 15 03:41:00 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Wed, 15 May 2013 03:41:00 -0000 Subject: [cmucl] #81: Reversing a string is slow Message-ID: <052.0e7c607d156cb27f17c6f5db91f5715e@common-lisp.net> #81: Reversing a string is slow --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2013-05 Keywords: | --------------------+------------------------------------------------------- Consider this: {{{ (defparameter *s* (make-string 1000000)) (defun time-rev (s) (dotimes (k 100 nil) (declare (fixnum k)) (setf s (reverse s))) s) (compile 'time-rev) (time (prog1 t (time-rev *s*))) ; Evaluation took: ; 10.23 seconds of real time ; 10.151641 seconds of user run time ; 0.079628 seconds of system run time ; 31,310,669,055 CPU cycles ; [Run times include 0.08 seconds GC run time] ; 0 page faults and ; 200,114,224 bytes consed. }}} Since strings are basically arrays of unsigned 16-bit integers, compare the time when reversing an array: {{{ (defparameter *v* (make-array 1000000 :element-type '(unsigned-byte 16))) (time (prog1 t (time-rev *v*))) ; Evaluation took: ; 3.62 seconds of real time ; 3.581727 seconds of user run time ; 0.039302 seconds of system run time ; 11,089,005,122 CPU cycles ; [Run times include 0.05 seconds GC run time] ; 0 page faults and ; 200,116,120 bytes consed. }}} Reversing a string is 3 times slower. There is some cost since strings are utf-16 encoded, but we shouldn't be 3 times slower. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Sun May 19 00:47:54 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Sun, 19 May 2013 00:47:54 -0000 Subject: [cmucl] #81: Reversing a string is slow In-Reply-To: <052.0e7c607d156cb27f17c6f5db91f5715e@common-lisp.net> References: <052.0e7c607d156cb27f17c6f5db91f5715e@common-lisp.net> Message-ID: <061.4c03751bdcb84886d20570e750aec519@common-lisp.net> #81: Reversing a string is slow ---------------------+------------------------------------------------------ Reporter: rtoy | Owner: somebody Type: defect | Status: closed Priority: major | Milestone: Component: Core | Version: 2013-05 Resolution: fixed | Keywords: ---------------------+------------------------------------------------------ Changes (by toy.raymond@?): * status: new => closed * resolution: => fixed Comment: commit 78cce51df441b220c071024fb5e616f1928184dd Author: Raymond Toy Date: Sat May 18 17:44:02 2013 -0700 Fix ticket:81 and fix ticket:83. From ticket 81, the tests are now: {{{ (time (prog1 t (time-rev *s*))) ; Evaluation took: ; 0.49 seconds of real time ; 0.481813 seconds of user run time ; 0.003624 seconds of system run time ; 1,490,776,936 CPU cycles ; [Run times include 0.13 seconds GC run time] ; 0 page faults and ; 200,073,704 bytes consed. (time (prog1 t (time-rev *s2*))) ; Evaluation took: ; 0.97 seconds of real time ; 0.965893 seconds of user run time ; 0.005139 seconds of system run time ; 2,980,415,911 CPU cycles ; [Run times include 0.23 seconds GC run time] ; 0 page faults and ; 400,005,560 bytes consed. }}} So the new string-reverse* is 20 times faster for strings without surrogates and 10 times faster for strings containing only surrogates. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation. From cmucl-devel at common-lisp.net Fri May 17 02:38:14 2013 From: cmucl-devel at common-lisp.net (cmucl) Date: Fri, 17 May 2013 02:38:14 -0000 Subject: [cmucl] #83: (reverse "") signals an error Message-ID: <052.5d0b9e6fa5f1d91184343a7d1de9bbc8@common-lisp.net> #83: (reverse "") signals an error --------------------+------------------------------------------------------- Reporter: rtoy | Owner: somebody Type: defect | Status: new Priority: major | Milestone: Component: Core | Version: 2013-05 Keywords: | --------------------+------------------------------------------------------- As noted in [http://article.gmane.org/gmane.lisp.cmucl.general/6497 the email from Matt Kaufmann], {{{(reverse "")}}} causes an error. -- Ticket URL: cmucl Cmucl is a high-performance, free Common Lisp implementation.