[codenameone-discussions] Re: SQLite and BLOB type

2019-04-04 Thread Shai Almog
Flash is slow especially in write. RAM/CPU cache are faster and they deplete with larger files. Feel free to benchmark this on a device. If it's easy feel free to implement a PR. -- You received this message because you are subscribed to the Google Groups "CodenameOne Discussions" group. To un

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-03 Thread Thomas
> > We'd need to detect the various types of arguments that are submitted and >> convert them to native calls for iOS. Passing arrays and other arbitrary >> objects to the C layer in the iOS port is painful so no one got around to >> do it for years. As I said, the demand for this was low and o

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-03 Thread Thomas
I never assumed that I am reading all the data nor that I have only one table. I only said that if you have 100 match for a query (you can have thousands of rows in your table. That is the point of having a DB, handling multiple objects not just one or two) then you would have to read 100 files

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-03 Thread Shai Almog
Several things here aren't true. First this assumes you are always reading all the data, if that was the case then why have an SQL database in the first place. It also assumes only one table and other tables aren't impacted. The second mistake is that randomly seeking through a large file is fr

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-02 Thread Thomas
On Wednesday, April 3, 2019 at 6:20:53 AM UTC+2, Shai Almog wrote: > > No. > We don't support byte buffers. Even if we did I'm talking about just using > a binary file which will always be faster than any sqlite implementation. > This will also allow reducing the database size which will make all

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-02 Thread Shai Almog
No. We don't support byte buffers. Even if we did I'm talking about just using a binary file which will always be faster than any sqlite implementation. This will also allow reducing the database size which will make all queries *much* faster. You are talking about JSON/XML which isn't what I'm

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-02 Thread Thomas
Blob provide a clear benefit on devices too. It allows to reduce the size of the database when you have large objects to store (not necessarily pictures. It can be geographic shapes like in spatialite for example or any other large object) and these objects can also be deserialised more quickly

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-02 Thread Shai Almog
It's a bit problematic to implement that API on iOS and most developers used workarounds since blobs aren't as necessary on devices. Unlike servers where the DB is distributed/clustered. On a device a blob provides no benefit and can impact performance. You are better off storing a file URI. --

[codenameone-discussions] Re: SQLite and BLOB type

2019-04-02 Thread Thomas
On Wednesday, April 3, 2019 at 2:54:04 AM UTC+2, Thomas wrote: > > I need to store some byte encoded serialized objects (like protobuf > encoded objects and similar) into an SQLite table. But I have seen in the > forum that there was some issues with the support of BLOB type in SQLite by > CN1.