Checking the stack callstack is extremely expensive. Use a thread local variable for detecting recursion and raising an exception.
Using the stacktrace means that JITs must exit because the stack must be reconstructed. On top of that, the deeper the call stack, the more expensive constructing the call stack becomes. This commit should provide the same safety, but be much cheaper than building a call stack.
For context, I was looking at some profiles of Mastodon, and I guess url is a popular (and expensive) method. 😅
Checking the stack callstack is extremely expensive. Use a thread local variable for detecting recursion and raising an exception.
Using the stacktrace means that JITs must exit because the stack must be reconstructed. On top of that, the deeper the call stack, the more expensive constructing the call stack becomes. This commit should provide the same safety, but be much cheaper than building a call stack.
For context, I was looking at some profiles of Mastodon, and I guess
url
is a popular (and expensive) method. 😅Thanks!