Shajeel Afzal
Shajeel Afzal

Reputation: 5953

Which is faster: Intent.putExtra or SQLite query?

I want to know that which way is faster in performance between Intent.PutExtra or SQLite query.

or

Upvotes: 2

Views: 573

Answers (1)

anddev84
anddev84

Reputation: 1483

Generally speaking, message passing using Intents is going to be faster than any kind of disk I/O, which is what a SQL query would be doing inevitably. That's not to say that in all scenarios this will always be true, which is why doing some benchmarking yourself would be helpful, since it would show in your scenario and for your implementation which way works better.

If you only have a few items that need to be passed from one Activity/Service to another, using Intents for message passing works well. But for large amounts of data or for persistence across device boots, etc, databases are the way to go.

Upvotes: 2

Related Questions