Closed Jiang-Junjie closed 2 months ago
@rolfbjarne ?
If I understand correctly, the problem is that your code is executing slower with MAUI than it did with Xamarin.Forms.
Do you see the same behavior with a Release build? Is it faster than a Debug build, or is it just as slow?
If I understand correctly, the problem is that your code is executing slower with MAUI than it did with Xamarin.Forms.
Do you see the same behavior with a Release build? Is it faster than a Debug build, or is it just as slow?
Yes, understand correctly. The problem was found in our release version. Therefore the release build not works faster. The release mode could make mostly process faster besides the EA function. I have no idea to make it faster now. If you could found other solutions for us to try, we will appreciate very much.
Can you try adding this to your csproj:
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<MtouchExtraArgs>--require-pinvoke-wrappers:true</MtouchExtraArgs>
<UseInterpreter>false</UseInterpreter>
</PropertyGroup>
and see if it makes a difference?
Can you try adding this to your csproj:
<PropertyGroup Condition="'$(Configuration)' == 'Release'"> <MtouchExtraArgs>--require-pinvoke-wrappers:true</MtouchExtraArgs> <UseInterpreter>false</UseInterpreter> </PropertyGroup>
and see if it makes a difference?
Thanks for sharing this, however it makes the application crashes when tapping it to start.
There is a little difference in my project that MtouchExtraArgs
already exists following configuration:
<MtouchExtraArgs>--require-pinvoke-wrappers:true --optimize=experimental-xforms-product-type -cxx -gcc_flags ...<MtouchExtraArgs>
I just put --require-pinvoke-wrappers:true
in the front of my current configuration.
Thanks for sharing this, however it makes the application crashes when tapping it to start.
It sounds like your app requires the interpreter for some reason. The interpreter is slower than AOT-compiled code, but it shouldn't make this much of a difference.
So we can try to enable the interpreter, but AOT-compile every assembly, which should hopefully make your app not crash at launch:
<PropertyGroup>
<MtouchInterpreter>-all</MtouchInterpreter>
</PropertyGroup>
Can you see if that works / changes anything?
Thanks for sharing this, however it makes the application crashes when tapping it to start.
It sounds like your app requires the interpreter for some reason. The interpreter is slower than AOT-compiled code, but it shouldn't make this much of a difference.
So we can try to enable the interpreter, but AOT-compile every assembly, which should hopefully make your app not crash at launch:
<PropertyGroup> <MtouchInterpreter>-all</MtouchInterpreter> </PropertyGroup>
Can you see if that works / changes anything?
Unfortunatly, it also not works as the same phenomenon. In addition, it will need more time to finish the build process almost above 6 mins.
As you said that, our project need UseInterpreter, and it exists in .csproj
:
<PropertyGroup>
...
<TargetFramework>net7.0-ios</TargetFramework>
<OutputType>Exe</OutputType>
<RootNamespace>PalmUI</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>
<UseInterpreter>true</UseInterpreter>
...
</PropertyGroup>
@rolfbjarne Finally, we have used <MtouchInterpreter>-all</MtouchInterpreter>
to solve this problem, and the crashed because some code. It's strange that these code work on debug mode. Thans for sharing the solution for us, it saves our project! I have already closed this case when you have a look at this.
Description
My prvious project(Xamarin Forms) is using EASessionController refers to Apple's sample:
and C# code now as follows:
The different is
NSStreamEvent.HasSpaceAvailable
between XF and Maui.XF as follows:
Maui as follows:
You will see that the same code, however each event of
HasSpaceAvailable
wll use more time than XF. The interval between the signals is more than 50ms.This confused me, because after I plugged in the USB, it would take 5S longer to respond than before, because the data size needed to be sent for the first connection was 171105 and the packet size was 1037.
This has greatly affected my experience of using the program, and I have not found any other solution to solve this problem, including this one issue.
Steps to Reproduce
No response
Link to public reproduction project repository
No response
Version with bug
Unknown/Other
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.101
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
No response