Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary __hx_cast calls #2066

Closed
waneck opened this issue Aug 11, 2013 · 1 comment
Closed

Remove unnecessary __hx_cast calls #2066

waneck opened this issue Aug 11, 2013 · 1 comment
Assignees
Labels
enhancement platform-cs Everything related to c#
Milestone

Comments

@waneck
Copy link
Member

waneck commented Aug 11, 2013

Performance-related: Specially on AOT, __hx_cast<> calls are expensive, and they get called even when it isn't needed. Maybe a cleanup on unnecessary TCasts would be a good way to solve this.

@dogles
Copy link
Contributor

dogles commented Feb 10, 2014

Is there a way to handle the general case (no conversion needed) without generic function call overhead? I'm thinking something like (not valid C#):

object __hx_cast(System.Type toType) { return (typeof(T) != toType) ? this.MyClass_cast<toType>() : this; }

@waneck waneck closed this as completed in 7d5d185 Mar 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement platform-cs Everything related to c#
Projects
None yet
Development

No branches or pull requests

2 participants