Giter Club home page Giter Club logo

Comments (6)

NCrouther avatar NCrouther commented on August 16, 2024

I took a crack at automating this with an annotation processor. #45

from ormlite-android.

kpgalligan avatar kpgalligan commented on August 16, 2024

Annotation processing is interesting. Took a quick look at the PR, but
would need to dig more heavily and test.

I did a really simple solution for 49 that reads and saves on first run
rather than compile time. Based on db version number. Positive is that
it'll run automatically. Negative is slow first run for DB.

I've been toying around with annotation processing and code to copy values
from the cursor into model objects. Generated can copy values about twice
as fast as reflection. Would be a pretty significant change, but hoping
somebody gets the urge to try it ;)

In any case, should pull the config gen code in to a version and see if we
can get some people testing.

On Fri, May 8, 2015 at 11:22 PM, NCrouther [email protected] wrote:

I took a crack at automating this with an annotation processor. #45
#45


Reply to this email directly or view it on GitHub
#40 (comment)
.

Kevin Galligan
http://about.me/kpgalligan

from ormlite-android.

NCrouther avatar NCrouther commented on August 16, 2024

Thanks for taking a look. Let me know if you have any questions. The big area to test would be to hammer on it with incremental compilation; I saw plenty of weirdness when changing annotated files in eclipse. I think all cases are handled properly, but be on the lookout for any spurious warnings/errors raised by the annotation processor during incremental builds.

I'd also definitely be interested in collaborating on expanding the use of annotation processors to eliminate more runtime reflection. I greatly prefer the ORMLite style to the other Android ORMs such as greendao, so if we can get comparable performance, it will be a slam dunk.

from ormlite-android.

kpgalligan avatar kpgalligan commented on August 16, 2024

Where did you learn the annotation processing stuff?
On May 9, 2015 6:37 PM, "Nathan Crouther" [email protected] wrote:

Thanks for taking a look. Let me know if you have any questions. The big
area to test would be to hammer on it with incremental compilation; I saw
plenty of weirdness when changing annotated files in eclipse. I think all
cases are handled properly, but be on the lookout for any spurious
warnings/errors raised by the annotation processor during incremental
builds.

I'd also definitely be interested in collaborating on expanding the use of
annotation processors to eliminate more runtime reflection. I greatly
prefer the ORMLite style to the other Android ORMs such as greendao, so if
we can get comparable performance, it will be a slam dunk.


Reply to this email directly or view it on GitHub
#40 (comment)
.

from ormlite-android.

NCrouther avatar NCrouther commented on August 16, 2024

This tutorial got me started: http://hannesdorfmann.com/annotation-processing/annotationprocessing101/

I also learned a lot by examining the source for: https://github.com/JakeWharton/butterknife

StackOverflow had a lot of great information about gotchas: http://stackoverflow.com/questions/tagged/annotation-processing

Unfortunately, much of it was trial and error and Googling problems as they came up.

from ormlite-android.

kpgalligan avatar kpgalligan commented on August 16, 2024

We actually ran the Droidcon NYC last year. Our video wasn't great,
though. JW gave a talk on annotation processing. Still need to dive into
it:

https://www.youtube.com/watch?v=tRmJm2_qytM

I want to review this: https://github.com/yahoo/squidb

Haven't had a chance yet to dig into it and see what its doing. I'm a
little wary of the generated code, as you're regularly using classes
derived from your own templates, which I think is disorienting. GreenDao
is totally weird. You actually write builder code to generate objects, and
adding your own code to your models is clunky. There was a performance
benchmark project that claimed 12x performance difference, but it was super
shady in how it was set up. See my blog post about:
http://kpgalligan.tumblr.com/post/111719199393/ormlite-android-performance

However, I did run my own tests with hand-rolled RowMapper's for OrmLite,
and there is a significant performance boost. I also suspect there might
be issues with lots of temp object creations that could be avoided. It'll
be a deep dive to replace that plumbing, but I think it would be well
received.

I also think something that will allow join queries in an efficient way
would be very helpful. To discuss.

On Sat, May 9, 2015 at 8:14 PM, Nathan Crouther [email protected]
wrote:

This tutorial got me started:
http://hannesdorfmann.com/annotation-processing/annotationprocessing101/

I also learned a lot by examining the source for:
https://github.com/JakeWharton/butterknife

StackOverflow had a lot of great information about gotchas:
http://stackoverflow.com/questions/tagged/annotation-processing

Unfortunately, much of it was trial and error and Googling problems as the
came up.


Reply to this email directly or view it on GitHub
#40 (comment)
.

Kevin Galligan
http://about.me/kpgalligan

from ormlite-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.