{"id":2543,"date":"2006-05-05T21:29:35","date_gmt":"2006-05-06T01:29:35","guid":{"rendered":"http:\/\/scruss.com\/blog\/2006\/05\/05\/the-commitments\/"},"modified":"2006-08-26T09:35:17","modified_gmt":"2006-08-26T13:35:17","slug":"the-commitments","status":"publish","type":"post","link":"https:\/\/scruss.com\/blog\/2006\/05\/05\/the-commitments\/","title":{"rendered":"the commitments"},"content":{"rendered":"<p>When I was testing BlackBerry typed-alike words (dactonyms?) I found that sqlite was averaging about 1 insert per second. This is by no means good.<\/p>\n<p>It turns out that, under Perl, sqlite auto-commits after every write. This slows things down terribly. Here&#8217;s how to fix this:<\/p>\n<p>When opening the database handle, turn AutoCommit off:<\/p>\n<blockquote><p>my $dbh =<br \/>\nDBI->connect( &#8220;dbi:SQLite:bberry2.sqlite&#8221;, &#8220;&#8221;, &#8220;&#8221;, { AutoCommit => 0 } )<br \/>\nor die &#8220;$!&#8221;;<\/p><\/blockquote>\n<p>Then, only commit occasionally &#8212; say every thousand writes:<\/p>\n<blockquote><p>while ( &#8230; ) {<\/p>\n<p>&#8230;$id++;<br \/>\n$dbh->commit unless ( $id % 1000 );<br \/>\n&#8230;<\/p>\n<p>}<br \/>\n$dbh->commit;<\/p><\/blockquote>\n<p>It works out about 1000 times quicker this way.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When I was testing BlackBerry typed-alike words (dactonyms?) I found that sqlite was averaging about 1 insert per second. This is by no means good. It turns out that, under Perl, sqlite auto-commits after every write. This slows things down terribly. Here&#8217;s how to fix this: When opening the database handle, turn AutoCommit off: my [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[7],"tags":[693,1302,323,946,1031,593,187,1366,1043,603,985,762,1204,1071,184,1008],"class_list":["post-2543","post","type-post","status-publish","format-standard","hentry","category-computers-suck","tag-693","tag-ack","tag-blackberry","tag-cc","tag-low","tag-pen","tag-perl","tag-quote","tag-slow","tag-sqlite","tag-tab","tag-test","tag-thousand","tag-tim","tag-time","tag-usa"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pQNZZ-F1","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/2543","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/comments?post=2543"}],"version-history":[{"count":0,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/posts\/2543\/revisions"}],"wp:attachment":[{"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/media?parent=2543"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/categories?post=2543"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/scruss.com\/blog\/wp-json\/wp\/v2\/tags?post=2543"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}