lessthanoptimal / BoofAndroidDemo

Demonstration of BoofCV for Android devices
125 stars 42 forks source link

Framerate of master 1fps vs 30fps with the packaged boofandroid apk version 1.8.1 #5

Closed forgescan closed 6 years ago

forgescan commented 7 years ago

this is a fantastic library, but after building the apk from master, I was surprised to find that it was massively slower on the same device than your prebuilt apk, Im sure theres an easy answer, is there something in the configuration that could account for this change? I didn't add DDogleg or EJML is that possibly the issue. Thanks!

lessthanoptimal commented 7 years ago

I'm a bit surprised! There was nothing special done for the apk on google play. Just your standard install. It's pure java so no special compiler flags. Those other libraries should have been included automatically by the gradle build script.

One possibility is that your getting video at different resolutions. You can check the settings to see what's going on there.

id301jack commented 7 years ago

I have the same issue. After download 1.8.1 -> 1.8 (05428d395b0b792fd73f710f0a4a72e451bd99e4 commit), it was solved.

id301jack commented 7 years ago

I found the solution. In build.gradle (Project) classpath 'com.android.tools.build:gradle:2.3.0' change classpath 'com.android.tools.build:gradle:2.2.3'

lessthanoptimal commented 7 years ago

Hmm but the version on the play store isn't affect by this?

forgescan commented 7 years ago

yeah the play version you made had it set properly to 2.2.3, its that android studio by default suggests you update to the newest gradle, which then causes the framerate issue.

lessthanoptimal commented 7 years ago

Any idea what's causing this problem? I would like to file a bug report or chime in saying that it's causing problems. I've gotten a couple of other reports of this.

forgescan commented 7 years ago

its a guess but i think it has something to do with the live reload functionality, which is enabled by default with gradle 3.3 on android studio, downgrading to 2.2.3 fixed it for me but kills the live reload

lessthanoptimal commented 7 years ago

@forgescan have you provide a link to the reload functionality? I did a quick search and got a bunch of links about cleaning your jar cache.

willchamberlain commented 7 years ago

Motorola Nexus 6: your version from Play Store 14-15 fps for square bianry fiducial at 640x480 - mine with com.android.tools.build:gradle:2.3.0 and gradle 3.3 is 0.3-0.5 fps, mine with com.android.tools.build:gradle:2.2.3 and gradle 3.3 is 5-6 fps.

abhishekkumardwivedi commented 6 years ago

Same issue here too with Nexus 5.

lessthanoptimal commented 6 years ago

Anyone figure out what is going on? I'm upgrading the app and using the latest version of gradle and it's way slower than older versions.

lessthanoptimal commented 6 years ago

Solved. there was a change in in Android which made debug mode much slower. set debug to false. also see readme.md for instructions.