Germán Diago <germandi...@gmail.com> writes: >> Aside from using a more recent Guile, I do not see obvious >> optimizations, however (more exactly: all my tries to speedup the code >> only made it slower). > > I was struggling with using read-line! instead of read-line but > experimenting in the command line > I cannot figure out how it works actually. read-line! will reuse a buffered > string. There was lots of time spent there, I am not sure if because of > allocations or just because of I/O. If someone could tell me how to do it...
One thing I realized now is that you might be able to avoid the string->number conversion completely since you’re outputting as text anyway. That might save 1/4th of the time (but I did not experiment with that now). Also I’m not sure whether the "is this a number"-check could be sped up by adding specialization for chars in the Scheme-compiler, similar to how floating point comparisons were added in the latest release: https://git.dthompson.us/guile.git/commitdiff/79fa147990021b48a5ede2f33441bc95721fe63d > Thanks for your time Arne! Thank you for the challenging problem :) Best wishes and happy hacking! Arne -- Unpolitisch sein heißt politisch sein ohne es zu merken
signature.asc
Description: PGP signature