15k inserts/s with Rust and SQLite (2021)
TLDR:  C++ is 115K inserts&#x2F;sec to 166K inserts&#x2F;sec<p>Here is a totally unscientific benchmark in C++.  Of course there is &quot;lies, damned lies and benchmarks&quot;.<p>AMD Ryzen 9 5900X 12-Core Processor<p>.&#x2F;sqlitetest<p>For writing to disk:
Inserted 1500000 records in 13 seconds, at a rate of 115385 records per second.<p>For writing to RAM: 
change users.db to :memory:
Inserted 1500000 records in 9 seconds, at a rate of 166667 records per second.<p>Credit goes not to me but to everyone&#x27;s favorite AI programmer.<p>I&#x27;ve made a tiny attempt to optimise - likely much more can be done.<p>To compile on Linux:<p>g++ sqlitetest.cpp -lsqlite3 -luuid -o sqlitetest<p><pre><code>    #include &lt;iostream&gt;
    #include &lt;cstring&gt;
    #include &lt;ctime&gt;
    #include &lt;chrono&gt;
    #include &lt;sqlite3.h&gt;
    #include &lt;uuid&#x2F;uuid.h&gt;
    
    struct User {
        uuid_t id;
        char created_at[25];
        char username[6];
    };
    
    int main() {
        sqlite3 *db;
        sqlite3_open(&quot;:memory:&quot;, &amp;db);
    
        const char *sql = &quot;CREATE TABLE IF NOT EXISTS users (&quot;
                          &quot;id BLOB PRIMARY KEY NOT NULL,&quot;
                          &quot;created_at TEXT NOT NULL,&quot;
                          &quot;username TEXT NOT NULL&quot;
                          &quot;);&quot;;
        sqlite3_exec(db, sql, nullptr, nullptr, nullptr);
    
        sqlite3_exec(db, &quot;BEGIN&quot;, nullptr, nullptr, nullptr);
    
        User user;
        char uuid_str[37];
        time_t now = time(nullptr);
    
        int count = 0;
        auto start = std::chrono::steady_clock::now();
    
        for (int i = 0; i &lt; 1500000; i++) {
            uuid_generate(user.id);
            uuid_unparse_lower(user.id, uuid_str);
            strftime(user.created_at, sizeof(user.created_at), &quot;%Y-%m-%d %H:%M:%S&quot;, localtime(&amp;now));
            strncpy(user.username, &quot;Hello&quot;, sizeof(user.username));
            sqlite3_stmt *stmt;
            sqlite3_prepare_v2(db, &quot;INSERT INTO users (id, created_at, username) VALUES (?, ?, ?);&quot;, -1, &amp;stmt, nullptr);
            sqlite3_bind_blob(stmt, 1, user.id, sizeof(user.id), SQLITE_STATIC);
            sqlite3_bind_text(stmt, 2, user.created_at, -1, SQLITE_STATIC);
            sqlite3_bind_text(stmt, 3, user.username, -1, SQLITE_STATIC);
            sqlite3_step(stmt);
            sqlite3_finalize(stmt);
            count++;
        }
    
        sqlite3_exec(db, &quot;COMMIT&quot;, nullptr, nullptr, nullptr);
    
        auto end = std::chrono::steady_clock::now();
        auto elapsed = std::chrono::duration_cast&lt;std::chrono::seconds&gt;(end - start).count();
        double rate = static_cast&lt;double&gt;(count) &#x2F; elapsed;
    
        std::cout &lt;&lt; &quot;Inserted &quot; &lt;&lt; count &lt;&lt; &quot; records in &quot; &lt;&lt; elapsed &lt;&lt; &quot; seconds, at a rate of &quot; &lt;&lt; rate &lt;&lt; &quot; records per second.&quot; &lt;&lt; std::endl;
    
        sqlite3_close(db);
    
        return 0;
    }</code></pre>