You are not logged in.
Pages: 1
Hello,
is it possible to use prepared statements with TTextWriter in SQLite3 with just the low-level functions and without higher ORM .pas files? And would that possibly yield a performance boost on a single PC system?
Thank you! In now use TTextWriter.AddNoJsonEscapeString() instead of AddString and the conversion warnings are gone. I also found AddComma, so instead of writing '),', I can simply use Add(')') and then AddComma. AddNull also comes in handy.
Hello,
is it more efficient to type-cast from String to RawUTF8 or to use RawUTF8 directly and implement new functions that return RawUTF8? And is the performance enhancement significant or marginal? I am talking about several million conversions overall.
Edit: Is there a function in TTextWriter that takes a string as an argument and converts it to RawUTF8 internally? I just want to avoid all the warning about implicit type conversions.
But are your columns dynamic or static? Because mine are dynamic and therefore ORM wouldn't make sense for me, right?
So there's actually no way to write concurrently into the SQLite3 db? Yes, I use low-level access, so to speak. I suspected high-level ORM functions to be slower than direct access. First I used a single thread for writing into the DB that collects the strings of multiple threads with direct access. That was relatively fast though. I use TTextWriter, btw. It's brilliant!
But shouldn't multi-threading be possible with SQLite3 if we use THREADSAFE=2? My data consists of records, each of which doesn't have an index (maybe that's the bottleneck?), but a timestamp and a box number, whereas the combination makes this record unique. I thought that since each row in unique, SQLite3 would use different b-trees for each entry. The order in which the rows arrive does not matter since we sort them afterwards anyway. I know it's not an SQLite3 support forum, but mORMot2 and SQLite3 are a bit intertwined.
A little update: Installing the package worked well and now my string building and db insertion combined is about 40% faster than before! Thanks a lot!
Do transactions with the flag "BEGIN CONCURRENT" exist in mORMot 2 as specific methods? So far I couldn't find this option anywhere. I'm trying to write into my SQLite3 db concurrently with multiple threads, but first I got "db is locked" errors and after using "BusyTimout := 10000" I get "NOTADB" errors. I already use WAL2 mode. Couldn't find this one implemented in mORMot 2 either. I'm also using serialized mode. Is there a way to change it into multithread with the library? I figured it's possible with "BeforeInitialized".
Thanks a lot. I will try this one out. Would you care to share how you created that package so I could make my own ones as well?
I have a big package with all the mormot2 units on it
I don't have any multithreading knowledge, and so don't know if the threadvars will work properly on a package. I suppose they will, but as I said, I can't really judge
Hello Javier. Would you be so kind to share this package with me? It would really help me out a lot! I use Delphi 11.3. Don't know if that matters though.
Has anyone here tried creating a Delphi package from /src and would like to share how he did it or even share the file? I use Delphi 11.3.
Pages: 1