On 7 Jan 2017, at 12:22pm, Simone Mosciatti <sisciamir...@yahoo.com> wrote:

> yes, of course I am doing the sequence prepare(), step()*, finalize()
> 
> Starts from here: 
> https://github.com/RedBeardLab/rediSQL/blob/master/rediSQL.c#L174

Okay.  That’s fine.  We get posts here from people who think that because they 
got SQLITE_DONE from _step() the statement’s resources have been released.

> However, even if I wasn't do it, I should just see an increase in memory, not 
> a so steep decrease in performance, correct?

sqlite_finalize() releases the block of memory and removes an entry from 
SQLite’s linked list of open statements.

Because of the way caching works, I would expect that dealing with 100,000 
blocks of memory (each one an INSERT command which has not had its memory 
released) would slow down my application.  I agree that it might not slow 
things down that much but I would still solve that problem first, before 
worrying about performance.

Depending on the needs of your application, it can be reasonable to buffer-up 
any number of database change commands, separated by ";", in a long text 
variable.  Then to use sqlite3_exec() to execute them all.

The problem with this is one you’ve already pointed out: if one of the commands 
returns an error, how do you proceed ?  But in many situations it doesn’t 
matter: all such errors would be fatal errors and your program should just 
crash anyway.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to