-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.3.49: rfe14972: speed up read-sock-line
This change does 3 things (from Gary, thanks): 1. double the buffer on each failure (instead of adding 1024) 2. optimize speed 3. declare types of various arguments and lexical variables They all have the effect of a massive speed up. The test case (also from Gary): (in-package :user) (eval-when (compile eval load) (require :aserve) (require :util-string)) (defun doit () (let* ((buffer (net.aserve::get-request-buffer)) (chars-seen (list nil)) (input (util.string:string+ (make-string (* 1 (expt 2 20)) :initial-element #\Space) #\linefeed))) (time (progn (with-input-from-string (s input :end (1- (length input))) (multiple-value-bind (values new-buffer start) (net.aserve::read-sock-line s buffer 0 chars-seen) (declare (ignore values)) (print (list :new-buffer-size (length new-buffer) :new-start start)))) nil)))) On teller, the times go (for the 1st time) from ; real time 23.622257 sec (100.2%) to ; real time 0.035985 sec (102.8%) Change-Id: Idc286aef88b6d903e4542426da97665226c7050e Reviewed-on: https://gerrit.franz.com:9080/7673 Reviewed-by: Kevin Layer <layer@franz.com> Tested-by: Kevin Layer <layer@franz.com>
- Loading branch information
Showing
2 changed files
with
16 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters