From a603cd8882910e12639d0b2c1e82c6a7e5b9c901 Mon Sep 17 00:00:00 2001 From: Dimitri Fontaine Date: Wed, 24 Jan 2018 23:26:37 +0100 Subject: [PATCH] Step back on (safety 0) optimization. It doesn't appear worth it at this time yet, too risky. --- src/pg-copy/copy-db-write.lisp | 14 ++------------ src/pg-copy/copy-format.lisp | 28 ++++------------------------ 2 files changed, 6 insertions(+), 36 deletions(-) diff --git a/src/pg-copy/copy-db-write.lisp b/src/pg-copy/copy-db-write.lisp index 0b09f28..d526de1 100644 --- a/src/pg-copy/copy-db-write.lisp +++ b/src/pg-copy/copy-db-write.lisp @@ -55,12 +55,7 @@ over again, as we reproduced the data formating in pgloader code. The reason we do that is to be able to lower the cost of retrying batches: the formating has then already been done." - (declare (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (declare (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let* ((col-bytes (map 'vector (lambda (col) (if (col-null-p col) 2 @@ -97,12 +92,7 @@ over again, as we reproduced the data formating in pgloader code. The reason we do that is to be able to lower the cost of retrying batches: the formating has then already been done." - (declare (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (declare (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let* ((col-bytes (map 'vector (lambda (col) (if (col-null-p col) 2 diff --git a/src/pg-copy/copy-format.lisp b/src/pg-copy/copy-format.lisp index de441c0..8441ce9 100644 --- a/src/pg-copy/copy-format.lisp +++ b/src/pg-copy/copy-format.lisp @@ -41,12 +41,7 @@ (apply-transforms copy nbcols preprocessed-row (transforms copy)))))) (defun format-vector-row (nb-cols row) - (declare (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (declare (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let* ((lens (map 'vector (lambda (col) (if (col-null-p col) 2 (copy-utf-8-byte-length col))) @@ -66,12 +61,7 @@ (defun format-escaped-vector-row (nb-cols row) "We've read data in the COPY format, so already escaped." - (declare (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (declare (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let* ((lens (map 'vector (lambda (col) (if (col-null-p col) 2 (utf-8-byte-length col))) @@ -133,12 +123,7 @@ (defun copy-utf-8-byte-length (string) "Calculate the amount of bytes needed to encode a string." (declare (type string string) - (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let ((length (length string)) (string (coerce string 'simple-string))) (loop :for char :across string @@ -197,12 +182,7 @@ encoded form of that character." "Convert a string into an array of unsigned bytes containing its utf-8 representation." (declare (type string string) - (optimize - (speed 3) - #-ecl(safety 0) #+ecl(safety 1) - (space 0) - (debug 1) - (compilation-speed 0))) + (optimize (speed 3) (space 0) (debug 1) (compilation-speed 0))) (let ((string (coerce string 'simple-string))) (declare (type (array (unsigned-byte 8)) buffer) (type fixnum position))