An in-depth study of Android-land showed that due to the crude Method.equals() method, annotations for Android are very slow and extremely intense GCs. We added table configuration files in version 4.26, which circumvented this and launched ORMLite much faster. See this question and this thread on the mailing list.
We continue to improve annotation speeds. See Also: Slow ORMLite Performance on Android?
Creating a DAO is a relatively expensive process. ORMLite creates a presentation of the data of both the class and the fields in the class and creates a number of other utility classes that help with the various DAO functionality. You must make sure that you call the createDao method once per call. I assume this is under Android @Pzanno?
In 4.16, we added DaoManager , whose task is to cache Dao classes, and this has been improved in version 4.20. You should always use it to create your Daos. Something like the following code is recommended:
private Dao<ModelStore, Integer> modelStoreDao = null; ... public Dao<ModelStore, Integer> getDaoStore() throws SQLException { if (modelStoreDao == null) { modelStoreDao = DaoManager.createDao(getConnectionSource(), ModelStore.class); } return modelStoreDao; }
Hope this helps. An audit of ORMLite memory is probably also in order. It has been a while since I looked at this consumption.
source share