Skip to content

Improve code generation performance/caching using open generic types #448

Description

@arashjfz

It is very useful that open generic types can be supported

Activity

  1. stakx commented on Jun 25, 2019

    @stakx
    Member

    Hi @arashjfz, can you describe one or more use cases why this would be a useful feature?

    (Implementing it would probably mean a lot of work, so—regardless of who would be implementing this—without having a clear incentive, it most likely isn't going to happen.)

  2. arashjfz commented on Jun 26, 2019

    @arashjfz
    Author

    Ok let met describe you a situation
    I am developing a framework like out system. We use nhibernate as ORM.
    for some reason we want to proxy the ISession and generic IQueryOver
    there are two solution to proxy the generic IQueryOver
    first one is to make type for all entities like IQueryOver'Employee' and etc. As you see this is not an efficient solution.Because if we have 1000 entities in our application we need 1000 dynamic type that override generic IQueryOver
    second one is to proxy the generic IQueryOver but in the format of open generic

    As you know stakx this behavior of generic type is the main different between Java and .net

  3. stakx commented on Jun 27, 2019

    @stakx
    Member

    If I understand you correctly, this would be mostly an optimization, then? You're not blocked from proxying the types you need to proxy--but you wish that DynamicProxy would be more efficient by making use of the CLR's "code sharing" for generic type instantiations?

  4. arashjfz commented on Jun 28, 2019

    @arashjfz
    Author

    yes exactly it is a performance problem

  5. changed the title [-]Is there any chance to supporting for open generic Types[/-] [+]Improve code generation performance/caching using open generic types[/+] on Jul 15, 2019
  6. arashjfz commented on Sep 25, 2019

    @arashjfz
    Author

    @stakx I am really interested in this issue. If it is possible I can give it a try

  7. stakx commented on Sep 25, 2019

    @stakx
    Member

    @arashjfz: Sure, it cannot hurt if you look into it and have a go at it. We do welcome contributions!

    A word of warning (not to discourage you up-front, but so you know what to expect), this might be non-trivial and amount to a fair bit of work. I for one don't expect to be able to provide much guidance (among other things, due to my current workload at work).

    Perhaps @jonorossi can let you know if and how this will fit with the planned release schedule.

  8. jonorossi commented on Sep 26, 2019

    @jonorossi
    Member

    @arashjfz go for it, contributions are definitely welcome. I should have time to answer specific questions, but like @stakx won't be able to dig in. Feel free to hack away at a prototype and submit a draft pull request for review. We can talk about releasing it when we've got something we all like.

  9. added theissue type on Dec 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions