Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SomeType($value) style coercions a la new-disp
Compared to the current implementation, we can lift out anything from some to a lot of the work and cache + guard it. The best case is when we have only a single argument to coerce and it is either a bare value or in a Scalar container, in which case we can also guard on the target type, pre-calculate the coercion type, and rewrite the call directly to its coerce method. It is possible that further examination will find even more direct mapping to the coercion implementation, but for now this already avoids calcualting the coercion type and arg flattening and slurpying, plus intermediate closure invocations, and so should be quite a nice win.
- Loading branch information
Showing
1 changed file
with
122 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters