Cache unknown multimethod value default dispatch

Description

Multimethods maintain a cache from dispatch value (result of the dispatch function) to dispatch method. If the dispatch value does not find a match in the available methods, it falls through to a lookup using the default dispatch value and returns that method. This default dispatch case is NOT recorded in the cache. This means that every case that falls through to the default case incurs a scan of the methodTable (and the class inheritance checks that involves).

Perf test:

And results:

Attached patch caches the mapping of unknown value -> default dispatch method and significantly improves the performance for this case.

Patch: clj-1429.patch
Screened by: Stu

Environment

None

Assignee

Unassigned

Reporter

Alex Miller

Labels

Approval

Ok

Patch

Code

Fix versions

Affects versions

Priority

Major
Configure