You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Improve code generation performance/caching using open generic types #448
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.)
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
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?
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
@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.
@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.
Activity
stakx commentedon Jun 25, 2019
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.)
arashjfz commentedon Jun 26, 2019
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
stakx commentedon Jun 27, 2019
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?
arashjfz commentedon Jun 28, 2019
yes exactly it is a performance problem
[-]Is there any chance to supporting for open generic Types[/-][+]Improve code generation performance/caching using open generic types[/+]arashjfz commentedon Sep 25, 2019
@stakx I am really interested in this issue. If it is possible I can give it a try
stakx commentedon Sep 25, 2019
@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.
jonorossi commentedon Sep 26, 2019
@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.