This makes a lot of small tweaks to improve performance throughout the library.
Reduces function calls and stack depth
str.format() invocations replaced with f-strings.
Redundant number type conversions removed.
partials passed to FrameEval replaced with closure equivalents where easy, sometimes requiring var name changes in outer func
Use dict literals instead of constructor.
Reduce obj attr lookups in detector FrameEvals by passing the set-adder instead of the set to the detection code.
Use tuples instead of lists for constants and defaults, also accept tuples in more places where it's the more appropriate data type.
I'm starting this as a draft PR so you can decide if you hate the changes or not while I take some time to type-check and test them. No need to worry about conflicting with this PR as I will rebase it with master as time permits.
This makes a lot of small tweaks to improve performance throughout the library.
str.format()
invocations replaced with f-strings.partial
s passed toFrameEval
replaced with closure equivalents where easy, sometimes requiring var name changes in outer funcdict
literals instead of constructor.FrameEval
s by passing the set-adder instead of the set to the detection code.I'm starting this as a draft PR so you can decide if you hate the changes or not while I take some time to type-check and test them. No need to worry about conflicting with this PR as I will rebase it with master as time permits.