satisfies? doesn't work with the new instance-based protocol polymorphism

Description

I'd expect that `satisfies?` works even when providing protocol implementation via metadata, however that doesn't seem to be the case:

Environment

None

Activity

Show:
Alex Miller
November 30, 2018, 2:08 AM

Would it be better to put the metadata check second instead of first for perf? Or is it actually faster?

Alex Miller
July 28, 2020, 2:01 PM

in the case of external or direct extensions there are single categoric things we can check to answer the question of satisfies? (either an entry in the protocol data or instanceof Java checks). with metadata extension, you have to look up the protocol methods and check whether one? all? are present in the metadata, and you need to do this check before external extensions, so it has a potentially large performance cost to add this check (which is an existing separate issue)

in general, leaning on satisfies? too much is usually a smell - you should instead be leaning on protocol polymorphism to handle conditional cases

Assignee

Unassigned

Reporter

Juraj Martinka

Labels

Approval

Triaged

Patch

Code

Affects versions

Priority

Major