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

Performance issue on start up #10

Closed
nis73 opened this Issue Feb 26, 2015 · 4 comments

Comments

Projects
None yet
2 participants
@nis73

nis73 commented Feb 26, 2015

Hi, when I start my App the initialization of RushORM takes more than 4 seconds. I'm initializing it as described in the onCreate() method of my application class:

public void onCreate(){
    super.onCreate();

    // initialilze database framework
    RushAndroid.initialize(getApplicationContext());
}

Is there any way to initialize the framework asynchronously or speed up the process?

I tried to externalize the initialization to a separate thread but got the following exception:

java.lang.NullPointerException: println needs a message
        at android.util.Log.println_native(Native Method)
        at android.util.Log.e(Log.java:231)
        at co.uk.rushorm.android.AndroidLogger.logError(AndroidLogger.java:37)
        at co.uk.rushorm.android.AndroidRushClassFinder.getRushClass(AndroidRushClassFinder.java:60)
        at co.uk.rushorm.android.AndroidRushClassFinder.getDomainClasses(AndroidRushClassFinder.java:45)
        at co.uk.rushorm.android.AndroidRushClassFinder.findClasses(AndroidRushClassFinder.java:36)
        at co.uk.rushorm.core.RushCore.upgrade(RushCore.java:312)
        at co.uk.rushorm.core.RushCore.initialize(RushCore.java:79)
        at co.uk.rushorm.core.RushCore.initialize(RushCore.java:54)
        at co.uk.rushorm.android.RushAndroid.initialize(RushAndroid.java:39)
        at co.uk.rushorm.android.RushAndroid.initialize(RushAndroid.java:23)
        at de.nisnet.app.billiardscore.BSApplication$1.run(BSApplication.java:26) 

Thanks in advance.

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Feb 26, 2015

Owner

If you turn off debug mode it should be much faster. Its slow because its doing a migration every run which is really helpful if you are changing your data modal, but in production a very infrequent process.

None the less I will have a look at making is async. Thanks

Owner

Stuart-campbell commented Feb 26, 2015

If you turn off debug mode it should be much faster. Its slow because its doing a migration every run which is really helpful if you are changing your data modal, but in production a very infrequent process.

None the less I will have a look at making is async. Thanks

@nis73

This comment has been minimized.

Show comment
Hide comment
@nis73

nis73 Feb 27, 2015

Thanks a lot. It works when I turn off debug mode.

nis73 commented Feb 27, 2015

Thanks a lot. It works when I turn off debug mode.

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Feb 27, 2015

Owner

I'm working on a fix as even if infrequent not a great use experience being delayed on start up. Just having a slight issue getting the tests to be happy with it async.

Owner

Stuart-campbell commented Feb 27, 2015

I'm working on a fix as even if infrequent not a great use experience being delayed on start up. Just having a slight issue getting the tests to be happy with it async.

@Stuart-campbell

This comment has been minimized.

Show comment
Hide comment
@Stuart-campbell

Stuart-campbell Mar 1, 2015

Owner

Initialization is now async in 1.0.4. If your using it through gradle compile I have had to change the maven source. New one is on the readme.

Thanks

Owner

Stuart-campbell commented Mar 1, 2015

Initialization is now async in 1.0.4. If your using it through gradle compile I have had to change the maven source. New one is on the readme.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment