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

use premade functions for common types #36

Open
lunixbochs opened this issue Feb 6, 2016 · 0 comments
Open

use premade functions for common types #36

lunixbochs opened this issue Feb 6, 2016 · 0 comments

Comments

@lunixbochs
Copy link
Owner

Take the signature/method examples from #35 (comment)

This should result in a very good speedup without resorting to dynamically generated code yet, as we can cache function pointers with correct types.

For alternate number types like int struc:"uint32", we can use a lookup table to generate conversions like this:

switch outer {
    case int:
        return func(i int) uint32 {
            return uint32(i)
        }
}

Or take the argjoy approach of IntToInt and see if type switching is still faster than outright reflection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant