Closed NiLuJe closed 1 year ago
Do you have any idea of the performance impact?
IIRC, error handling in Lua involves a setjmp
/longjmp
pair, so, depends on how good the CPUs are at jumps (plus the extra context switches it involves) ;).
But even regardless of the pcall
implementation details, it is mechanically slower, if only because of the multiplication of function calls ;).
That said, we're, comparatively, doing this for a limited number of calls, once (at require-time), so I don't expect a significant impact (and it essentially future-proofs this against future conflicting additions in base).
(i.e., I'd be warier if we were doing this globally).
Well yeah, even if it were more than a hundred times slower it'd probably still be fast and unproblematic. Just curious. ;-)
To avoid conflicts with koreader-base once and for all...
This change is