0

in ormlite the annotations @DatabaseField are used to help create the database schema configuration file, and it then uses the configuration file for referencing variables in model objects, if I understand correctly.

The Ormlite documentation says this is used as an alternative for annotations because the java reflections api takes a lot of resources and causes a lot of garbage collection, which is true. Does this mean that I can remove all of my @DatabaseField lines and it will perform better?

CQM
  • 42,592
  • 75
  • 224
  • 366

1 Answers1

1

The Ormlite documentation says this is used as an alternative for annotations because the java reflections api takes a lot of resources and causes a lot of garbage collection, which is true.

It is indeed. Here's my post on the subject: Why are annotations under Android such a performance issue (slow)?

Does this mean that I can remove all of my @DatabaseField lines and it will perform better?

No. Once you have the configuration file, the @DatabaseField annotations should not be referenced at all. Removing them will only make it harder to regenerate the config file when you change your schema.

Community
  • 1
  • 1
Gray
  • 115,027
  • 24
  • 293
  • 354