Android acting really slowly (simulator and ios ok)

Not sure if this is widget related but given the log messages i decided to give this a go here:

Same build on iPhone works just fine … Android seems to function ok but everything is dog slow … not sure where that saying comes from as i dont really think of dogs as slow … but i digress …

The log shows something interesting:

V/Corona  ( 9339): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona  ( 9339): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona  ( 9339): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button.  

Got no clue about what that might be.  No clue if that is even what the issue is … but that shows up in the logs for all the different widgets … seems like once for each widget used. 

These messages do not show on the simulator or on the iPhone … and as mentioned i have no issues on those devices.

Am currently on Build 1100

This is a serious show stopper … seems to have changed recently with the nightly build. 

Anyone seeing anything like this?

Hi I have noticed also very slow the scrollview widget and opened a new topic in this forum:

http://forums.coronalabs.com/topic/34680-scrollview-with-images-load-very-slow/

I do not know if it has anything to do or be for the same reason.

Thanks for the reply.  Don’t think that is the issue as this is occurring on all storyboard scenes with or without a scrollview.

I suspect that that log message has some meaning that i don’t get.  Like i said … only see that log message on the android.

Wondering why the path on that is "/data/data … " … seems odd. 

I suspect that your device is almost out of space in internal storage.  Try clearing some space and then re-run your app.  That should give rid of that error message that you see in the log.

That said, we’ll likely be getting rid of that “plugins.dex” file in the near future.  After beta testing our optional plugin support on Android, we’ve decided to change the design on how plugins are dynamically loaded at run time, which will get rid of that dex file completely.

Now, the above will only cause performance issues on startup.  If your app always exhibits slow performance, then the above issue is unrelated.  In which case, I suggest that you try running our sample app “Interface/WidgetDemo” that is included with the Corona SDK on your Android device and see how well it performs.  I suspect this is not a widget issue because that sample app performs well on my low-end Android devices.

The more likely case is that too much text is getting rendered.  Text rendering is *very* expensive on Android because it involves drawing the text to a bitmap and then pushing that bitmap to OpenGL as a texture.  If text is getting updated on every render pass, then that would definitely kill performance.

well i cannot imagine that it is the text … code has not changed … Only thing that changed was the corona build i was using

sure you cannot think of anything else that might be at issue.

What i have is a simple scene with a couple of buttons … i press a button and i get a long delay (3-4 seconds) before the button executes. While that delay is happening i see those related log messages i mentioned … lots of them.

Are you saying the screen transition was not slow with an older build?

If so, can you tell me which daily build number please?

Also, are you requiring anything in when you load a storyboard scene?
If so, then that would trigger the slow down.  You only need to require a library in once.

Not sure i am following you on the: “Also, are you requiring anything in when you load a storyboard scene”

Seems to happen on all of my scenes and ONLY on android.  IOS performs fine.  Cannot be a memory issue the issue occurs immediately and before i am doing anything but loading a few buttons.

here are the requires at the top of one of my scenes that is not happy:

local storyboard = require( "storyboard" ) local scene = storyboard.newScene() local widget = require("widget") local utilsArcherz = require("utilsArcherz") local XDisplayToastInfo = require("XDisplayToastInfo")

is “/data/data” really the path?

/data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex

Why would i get these failures on android and not on ios device or simulator?

loading the page in question i receive:

V/Corona (16077): \> Class.forName: widgetLibrary.widget\_tableview.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_tableview.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_tableview. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button. V/Corona (16077): \> Class.forName: widgetLibrary.widget.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button. V/Corona (16077): \> Class.forName: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Loading plugins: widgetLibrary.widget\_button.LuaLoader V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget\_button.

This is a real issue for us.

Thanks for giving me your thoughts on this one.

One more detail … exact same code running on build 1080 DOES NOT exhibit this issue.

Snappy on android … i suspect someone introduced some badness.

The slow down occurs due to your require statements because it involves accessing the file system.  Try changing your code so that you only require libraries once instead of every time you load a scene.  That will work-around this issue.

The slow-down issue is currently caused by our plugin system which is currently in beta.  We’ll be modifying the behavior in the near future to eliminate the slow-down.  But in the meantime, the above work-around will solve this issue… and improve performance a bit on iOS too since it will avoid file system access.

Glad to know that i am not going crazy …

So are you suggesting that i make those globals? 

Loading them in the main?

I thought that the recommended way to do things was with local variables and not with Globals.

Can you help me understand what you are specifically suggesting with your work-around suggestion.

Thanks,

m

Joshua,

I am experiencing widget problems as well but in connection with widget.newButton (see here, things are really slow on Android). You explained a workaround however I am requiring widget.lua in my main.lua only once at startup and not multiple times thereafter. So this workaround will not help me - is there any other temporary fix to this? Otherwise I will not be able to build and release my game for Android.

Thanks,

Jens

Poke … Joshua … can you respond please … this bug is not helping our cause much.

Thanks!

m

@Joshua, @heftyApps

I also tried the suggested WA with unique “widget” library requirement in the main, and Android still has the same very slow performance for widget 2.0 elements.

When this issue is planned to be fixed? Thanks

@mslack how can you see the logs on Android device for Corona application? I mean:

V/Corona (16077): Loading plugins: widgetLibrary.widget_tableview.LuaLoader
V/Corona (16077): Failed to write file: /data/data/com.missingmarble.archerzupshot/cache/.system/resources/plugins.dex for library widgetLibrary.widget_tableview.

Thanks

using the android debugging tools the following into the command line gets the console output:

./adb logcat Corona:v *:s

@mslack thank you very much. It is great :slight_smile:

Any word on this bug?  This is a show stopper and with a delivery deadline looming it would certainly be helpful for this one to find a resolution.

Cheers!

m

+1

A quick fix to this would be really helpful - I can’t publish for Android as long as this has not been sorted out. Thank you!

Jens

I am seeing exactly the same behavior on Android only with the same error messages in the logs.

Any news from Corona Labs on this issue?  Stopping the show for Android this one is.