sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Function local method signatures optimization #970

Open iskiselev opened 8 years ago

iskiselev commented 8 years ago

All signatures that refers class/function generic parameter ends in function local method signatures (var $s__ = new JSIL.MethodSignature(...);).

This signatures often used for only one method call (and they are not cached), but they still use high-cost JSIL.CreateNamedFunction. We should either put them in some signature-cache (same as all other function signatures) or make some special processing inside that will just use call/apply method inside in that case.

EDITED: This task is very important to improve LINQ and async/await speed for translated BCL.

iskiselev commented 8 years ago

Looks like "CodeGenerator": { "CacheGenericMethodSignatures": false }, should disable them - but looks like it currently just crash on compiling with it.

kg commented 8 years ago

Putting them in a shared cache with everything else sounds like a good idea.

iskiselev commented 8 years ago

@kg, why do you use type references in non function local signatures instead of type identifiers? EDITED: I believe you've done it because of reusing same code (Signature) for writing type meta information. Is it correct?

kg commented 8 years ago

I honestly don't remember. Sounds like it might just be an artifact of old code doing the wrong thing. Could be code reuse, yeah.