Details
-
Type:
Enhancement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: Release 1.5
-
Component/s: None
-
Labels:
-
Patch:Code
-
Approval:Ok
Description
The attached patch copies metadata given to the method name symbol of memfn to the method receiver in the expansion. That way, memfn is able to be used even for type-hinted calls resulting in a big performance win.
user> (time (dotimes [i 1000000] ((memfn intValue) 1))) Reflection warning, NO_SOURCE_FILE:1 - call to intValue can't be resolved. "Elapsed time: 2579.229115 msecs" nil user> (time (dotimes [i 1000000] ((memfn ^Number intValue) 1))) "Elapsed time: 12.015235 msecs" nil
Attachments
Activity
Tassilo Horn
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Description |
The attached patch copies metadata given to the method name symbol of memfn to the method receiver in the expansion. That way, memfn is able to be used even for type-hinted calls resulting in a big performance win.
user> (time (dotimes [i 1000000] ((memfn intValue) 1))) Reflection warning, NO_SOURCE_FILE:1 - call to intValue can't be resolved. "Elapsed time: 2579.229115 msecs" nil user> (time (dotimes [i 1000000] ((memfn ^Number intValue) 1))) "Elapsed time: 12.015235 msecs" nil |
The attached patch copies metadata given to the method name symbol of memfn to the method receiver in the expansion. That way, memfn is able to be used even for type-hinted calls resulting in a big performance win.
{noformat} user> (time (dotimes [i 1000000] ((memfn intValue) 1))) Reflection warning, NO_SOURCE_FILE:1 - call to intValue can't be resolved. "Elapsed time: 2579.229115 msecs" nil user> (time (dotimes [i 1000000] ((memfn ^Number intValue) 1))) "Elapsed time: 12.015235 msecs" nil {noformat} |
Tassilo Horn
made changes -
| Attachment | 0001-Make-memfn-allow-for-type-hinting-the-method-receive.patch [ 10985 ] |
Tassilo Horn
made changes -
| Attachment | 0005-Make-memfn-allow-for-type-hinting-the-method-receive.patch [ 10772 ] |
Rich Hickey
made changes -
| Approval | Vetted [ 10003 ] | |
| Fix Version/s | Backlog [ 10035 ] | |
| Fix Version/s | Release 1.5 [ 10150 ] |
Aaron Bedra
made changes -
| Approval | Vetted [ 10003 ] | Screened [ 10004 ] |
Rich Hickey
made changes -
| Approval | Screened [ 10004 ] | Ok [ 10007 ] |
Stuart Halloway
made changes -
| Resolution | Completed [ 1 ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |
Updated patch.