Currently `satisfies?` doesn't use the same impl cache used by protocol methods, making it too slow for real world usage.
Cause: `satisfies?` calls `find-protocol-impl` to see whether an object implements a protocol, which checks for whether x is an instance of the protocol interface or whether x's class is one of the protocol implementations (or if its in an inheritance chain that would make this true). This check is fairly expensive and not cached.
Proposed: Extend the protocol's method impl cache to also handle (and cache) instance checks (including negative results).
Patch: CLJ-1814-v7.patch (depends on )
Patch with test
Verified that test fails with v4 patch:
Has this patch missed the 1.9 train? There was a fix we were hoping to make in HoneySQL that I'd hesitate to make with satisfies? as slow as it is.
Not necessarily. We don't add features after 1.9 but perf stuff like this is still possible. It's been vetted by Rich. It's in my list of stuff to screen.
Updated patch to work after the new instance-based protocol dispatch, this ticket should wait for first