If I can find out which keys I used most, I may create a macro for it; if I can find out which function I used most yet not binded, I can bind it to a key. This may improve efficiency. Is there a way to get these statistics knowledge?
If you use
smex-show-unbound-commands command does exactly that; show the commands that you use frequently using
M-x (the suggested
smex binding) but have yet to be bound to a key binding.
I used to use keyfreq. It was good, but eventually I switched it off and went back to using my intuition.
You can view the last 300 keystrokes with
C-h l calling the
view-lossage function. Inspect the displayed buffer to see what 300 keys you last hit.
If you call
view-lossage you will see that you can also use the
open-dribble-file function to start writing (record) all characters you type to a file.