First look at the source code:
(defun aa nil
(setq a 88)
(set 'a 88)
(princ (read "bb"))
(set (read "bb") 88)
)
Through experiments, (setq a 88) and (set 'a 88) are completely equivalent. Setq is set quote.
After compiling to fas, the code looks like this:
14 00 00 00 00 Instruction 20, the function starts
32 58 06 05 00 (setq a 88)
09 05 00 32 58 35 02 04 00 03 0A (set 'a 88)
09 03 00 35 01 02 00 03 35 01 01 00 03 0A (princ (read "bb"))
09 03 00 35 01 02 00 03 32 58 35 02 04 00 03 (set (read "bb") 88)
16 Instruction 22, the function ends
String used:
05 / A
04 / SET
03 / "bb"
02 / READ
01 / PRINC
It can be seen that (setq a 88) was compiled into an instruction, and the function was completed directly with instruction no. 6
(set 'a 88) is compiled to call function SET, which takes two arguments, one with the symbol a (05) and the other with 88
In conclusion, setq does not need to call functions, it is faster, and the compiled code is shorter and more concise.