Is FlatBuffers faster than SharedPreferences

63 views
Skip to first unread message

minh duc pham

unread,
Mar 31, 2017, 6:49:35 AM3/31/17
to FlatBuffers
Hi all,

Like the subject, I wonder if FlatBuffers is faster than SharedPreferences. My mobile application uses about 3000 key-value sets using SharedPreferences, and the value is just the primitive type, any other object types is not much (and I believe FlatBuffers can handle this perfectly). So I wanna ask "is it worth moving from SharedPreferences to FlatBuffers?"

Thank you very much for any your thoughts
MinhPham

Maxim Zaks

unread,
Mar 31, 2017, 8:34:47 AM3/31/17
to FlatBuffers
I am not sure what to tell you about storing 3000 key value sets in SharedPreferences :)
But generally as far as I see SharedPreferences are stored as XML file.
Reading this amount of data from FlatBuffers will be definitely faster. Specially if you need only a fraction of 3000 values.
Writing should be more performant as well, but I suggest you profile/measure it.

minh duc pham

unread,
Apr 3, 2017, 10:27:58 PM4/3/17
to FlatBuffers
Thank you very much Maxim, I'll consider it :). 
Reply all
Reply to author
Forward
0 new messages