9:50:36pveHi! If I have a generic function "whitespacep" and compare it with another, "make-whitespace-predicate", which returns a function that recognizes whitespace, I get these results:
9:52:16no-defun-allowedThat is quite possible, yes.
9:52:18beachIt is always tricky to do performance analyses on such small functions.
9:52:56pveI'm mostly interested in whether make-whitespace-predicate "should" be faster
9:53:12pveI feel it should, since there is no dispatch involved
9:53:25no-defun-allowedwhitespacep would perform method dispatch every time it is called, whereas make-whitespace-predicate only performs dispatch once. For such a small function, the runtime of method dispatch might be comparable to the runtime of your method.
9:55:13no-defun-allowedbeach: Are you sure? I'm reading the opposite: test-1 invokes a generic function and takes 1.5 seconds, and test-2 does not and takes 0.6 seconds.