Bug 5189 - Float assignment becomes 10x slower when disabling "use shared runtime"
Summary: Float assignment becomes 10x slower when disabling "use shared runtime"
Alias: None
Product: Android
Classification: Xamarin
Component: Mono runtime / AOT Compiler ()
Version: 4.2.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2012-05-20 00:27 UTC by zachbarth
Modified: 2012-05-20 17:06 UTC (History)
3 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description zachbarth 2012-05-20 00:27:53 UTC
The following code runs roughly 10x slower when "use shared runtime" is disabled:

float foo = 12345;
float bar;
for (int i = 0; i < 1000000; i++)
    bar = foo;

Notably, the slowdown does not happen when foo and bar are ints or doubles. To test this, we inserted the above code into the OnRenderFrame() function in the OpenGL template project, wrapped with a Stopwatch.

This causes a horrendous slowdown (10x or greater) in our game in release builds, which makes it unshippable.
Comment 1 Zoltan Varga 2012-05-20 07:56:28 UTC
The runtime which is compiled into the app is probably built for soft-float.
Comment 2 Jonathan Pobst 2012-05-20 12:11:13 UTC
Go to Project Properties and add the armeabi-v7a architecture to your application.  It is included in the shared runtime, but you need to opt into it for your application, since it will add about 1 MB to your release .apk.
Comment 3 zachbarth 2012-05-20 15:17:26 UTC
Amazing! Everything runs perfectly now - thanks so much!