-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Incremental steps to netnative support #3478
Conversation
How does this effect perf? Does it make the benchmarks we have significantly slower? |
Also, have we considered cross-compiling so we only do this for UWP apps? Since perf is a priority it seems counter-productive to on the one hand be trying to improve perf, while with the other hand removing code that was specifically added to help with perf. |
I suspect perf will be worse. I can actually test the numbers to see how much. We are not currently set up to cross compile to UWP. @bricelam would know better how we could set that up. Alternatively, we could catch the runtime exception thrown only on .NET Native and then invoke this slower path which preserves the original path for all other cases. |
I think we should discuss after seeing how much it affects our current benchmarks. |
InternalImplyValuesAndTypes<TEntity> EntityValueProp; | ||
|
||
InternalImpliesTypes<TEntity> EntityProp; | ||
InternalImpliesTypes<char> CharProp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a way we can do this in providers since primitive type support is tied to providers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a better method is to expose a utility class publicly and let providers pass in their primitive types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like that. Also, I kept mulling on it after our in person discussion and here are some of my thoughts:
- The goal is to make .NET Native support as transparent as possible to application developers (as opposed to provider writers)
- I would like to see providers do whatever they need to do so that their valid primitive types are supported in .NET native in code that is near/related to their type mapper
- If we do this for some well known set of types in the core it actually increases the chances that providers are just going to miss that they need to do it for all the types they support in their type mapper until they have some customer trying to use a particular type that is not part of the subset on .NET Native.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@divega I added some of the related actionable items of these in #623 (comment).
To my surprise, this actually improves perf: [Benchmark(Iterations =10)]
public void ConstructGetterSource(IMetricCollector collector)
{
var entityType = new EntityType(typeof(Poco), new Model());
var prop = entityType.AddProperty("Id", typeof(int));
for (var i = 0; i < 100000; i++)
{
var getter = new ClrPropertyGetterSource();
var setter = new ClrPropertySetterSource();
collector.StartCollection();
getter.GetAccessor(prop);
setter.GetAccessor(prop);
collector.StopCollection();
}
}
|
@natemcmaster That looks good--what is the impact on our existing benchmarks? |
@ajcvickers The changes to existing perf benchmarks was hardly significant. I had to run 100,000 iterations to get numbers I could believe were significantly different. |
Just checking that you got those numbers on a release build and not a debug one (since that is the perf we care about) |
Good point. Those were Debug. I'll re-run on release mode. |
@natemcmaster I misunderstood the code when I looked at it last night. I see now that it doesn't change the cached delegate path, and hence I'm not surprised that the overall benchmark numbers are okay. I can say for those code changes. The "implies" stuff and how it is supposed to work is a mystery to me, so somebody who knows about that should look. |
@ajcvickers Good to know. Everyone else, there is gonna be a whole lot more awful "implies" stuff, so brace yourselves. This stuff exists only to trick ILC (the .NET Native compilation step) to keep metadata about generic methods and types we use at run time. |
31f6f24
to
8986a17
Compare
Merged with c35ce4d |
Changes necessary to make the very basic UWP app work in Release mode (after .NET Native mangles it).
Will still require a patch to Relinq (re-motion/Relinq#6)
Makes significant progress on #623