Hi Attila,
Attila Lendvai attila.lendvai@gmail.com writes: [...]
arguably in this case it should be :maximum-length but max/min is so well spread that it's one of the very few abbreviations that we accept internally in public API. but it's your lib... my patches are only suggestions! :)
I should revisit the code anyway to add single and double floats and as you are so nice about it, I accept your suggestion :-)
[...]
You change it to an nreverse!
do some profiling... ;)
it's not faster for sure, but i doubt you'll be able to point out the difference.
Thinking about it the whole idea of building up a list of things to concatenate (now with nreverse) and then concatenating them in a weird way is wrong. (The nreverse should be high up on the profile and if it's not then that's a bug showing that the rest is too slow.)
There shouldn't be the big difference between byte-vectors and strings either.
I will get together a benchmark and make a better implementation.
[...]
Why are you using BODY here for a non-code form?
it plays much better with slime indentation, but that's about all.
i usually freely exchange &body and &rest as they have no other effects than that (and documentation-wise it's arguable that the body there really is a body, that body is just a DSL not lisp...)
That makes sense. Good points.
This makes no difference I believe ^^^^
profile it. on sbcl with-output-to-string creates a string-output-stream which is more expensive when pretty-printing stuff is initialized.
Thanks for the info!
This rewrite seems in aid of faster string concatenation. I have a good strcat somewhere, I can put that in. Do you have a benchmark?
not for this specific case, but i went through quite a few profiling sessions and it seemed to be the fastest string concatenation (on sbcl).
Before tpd2 dumped strings altogether I had a fast strcat.
However, copying strings multiple times for no reason surely isn't a good idea, and that's what's happening here. I will try to come up with a better way.
Should be done before Monday, if not shout!