Skip to content
Snippets Groups Projects
Commit 2d5e49fb authored by Elias Mårtenson's avatar Elias Mårtenson
Browse files

Performance optmisation for COPY-STREAM-TO-STREAM

Previously, the buffer was reallocated for every block copied. This
change ensures that the same buffer is being reused.
parent fbb9bc11
Branches
Tags
No related merge requests found
...@@ -351,7 +351,7 @@ Otherwise, using WRITE-SEQUENCE using a buffer of size BUFFER-SIZE." ...@@ -351,7 +351,7 @@ Otherwise, using WRITE-SEQUENCE using a buffer of size BUFFER-SIZE."
(when eof (return))) (when eof (return)))
(loop (loop
:with buffer-size = (or buffer-size 8192) :with buffer-size = (or buffer-size 8192)
:for buffer = (make-array (list buffer-size) :element-type (or element-type 'character)) :with buffer = (make-array (list buffer-size) :element-type (or element-type 'character))
:for end = (read-sequence buffer input) :for end = (read-sequence buffer input)
:until (zerop end) :until (zerop end)
:do (write-sequence buffer output :end end) :do (write-sequence buffer output :end end)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment