Optimizing Common Lisp Speed and executable Size
Posted: Fri Nov 21, 2014 6:39 pm
What should I watch for if I write small programs in Common Lisp, which don't do much. I wrote a program that only executes some small functions to interact with the desktop-manager.
But the execution of the program has a recognizable duration (should be faster)
Would it be faster if not the whole common lisp system were included? How can I only load functions, I will need in the program?
Does it affect the execution speed if I don't compile the file, but only create the executable after loading, when I use sbcl? (normally it should always compile I think, there can be many problems, when I use compile-file, because not everything is done normally)
How useful are type-declarations? I think, they do not use much if there are multiple possibilities (for example the type "(or number symbol string char)")
Should I let the Program opened and not reload it every time I use a command (because I need it very often, but there is no initialization that only would run one time)? (I don't know how I should do this, if it is useful)
That's it! I hope, someone can help.
PS:
I use trivial-shell:shell-command to execute commands and cl-json to read some input, I don't know, if they may be slow
But the execution of the program has a recognizable duration (should be faster)
Would it be faster if not the whole common lisp system were included? How can I only load functions, I will need in the program?
Does it affect the execution speed if I don't compile the file, but only create the executable after loading, when I use sbcl? (normally it should always compile I think, there can be many problems, when I use compile-file, because not everything is done normally)
How useful are type-declarations? I think, they do not use much if there are multiple possibilities (for example the type "(or number symbol string char)")
Should I let the Program opened and not reload it every time I use a command (because I need it very often, but there is no initialization that only would run one time)? (I don't know how I should do this, if it is useful)
That's it! I hope, someone can help.
PS:
I use trivial-shell:shell-command to execute commands and cl-json to read some input, I don't know, if they may be slow