cl-cookbook
cl-cookbook copied to clipboard
Request: Add content on profiling and performance tuning
In my humble opinion one big advantage of Common Lisp is that it can be dramatically fast while providing great power.
Sometimes we just want our programs to be faster, so profiling and performance tuning might be interesting to some people.
Outline:
- Profiling
- Macro
TIME - Macro
TRACEandUNTRACE - Macro
DISASSEMBLE
- Macro
- Performance Tuning
- Macro
DECLAREwithtype,optimizeetc - Macro
INLINE - Package
INLINED-GENERIC-FUNCTION
- Macro
I am willing to draft it.
Any idea?
There is something in https://lispcookbook.github.io/cl-cookbook/debugging.html and maybe this chapter about debugging is still missing some useful tips from https://malisper.me/debugging-lisp-part-1-recompilation/
That would be great !
Related to #104 ? Explaining and showing types.
trace is covered in debugging.
@arademaker I think the most important point of your link is covered (about declaim… debug 3), but there is no "story telling" (as I wasn't able to reproduce).
True. TRACE is more debug related. My mistake.
Oh! I saw #104 before opening this one, and I totally agree that CL's type system should be introduced for its great flexibility and huge optimization potential.
I think maybe we can add a new page introducing performance related things, including my original outline plus some points referred in #104.
The type system can be explained in detail between section Profiling and Performance Tuning.
By doing so, this page will be organized in an order of profiling -> type system knowledge -> tuning (with examples).
I think it should be logical and practical. What do you think?
Or is it better to introduce type system as a specific chapter?
By doing so, this page will be organized in an order of profiling -> type system knowledge -> tuning (with examples).
sounds really good.
The type system might be introduced gently as a specific chapter (issue 104: "I don't know CL, what good is the type system ?"), and explained in detail within your section ("I wrote some Lisp. What about performance tuning ?"). May I suggest to start with easy things, given IMO this Cookbook is primarily for newcomers ? However, please yourself, whatever you write will be an excellent addition. "publish early publish often" they say :p
The type system might be introduced gently as a specific chapter (issue 104: "I don't know CL, what good is the type system ?"), and explained in detail within your section ("I wrote some Lisp. What about performance tuning ?").
Sounds reasonable. So in total 2 chapters:
- CL's type system and its properties (contents covered in #104).
- Performance related stuff (how to use
DECLAREwill be introduced here).
May I suggest to start with easy things, given IMO this Cookbook is primarily for newcomers ?
Sure. I will draft something ASAP and issue a PR within next week.