Skip Menu |

This queue is for tickets about the ORDB-Unihan CPAN distribution.

Report information
The Basics
Id: 83859
Status: resolved
Priority: 0/
Queue: ORDB-Unihan

People
Owner: Nobody in particular
Requestors: daxim [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 0.02
Fixed in: (no value)



Subject: bulk load takes too long due to excessive fsync()
The first use of ORDB::Unihan creates the SQLite database in the background. Every few kilobytes, the database syncs the changes and journal to disk. This is exceedingly slow. No one has the patience for a three hour build time. With the following patch, creating the database only takes a minute. diff --git a/lib/ORDB/Unihan.pm b/lib/ORDB/Unihan.pm index 39c8af2..650cc9f 100644 --- a/lib/ORDB/Unihan.pm +++ b/lib/ORDB/Unihan.pm @@ -150,6 +150,10 @@ sub import { PrintError => 1, } ); + $dbh->do('PRAGMA synchronous=OFF'); + $dbh->do('PRAGMA count_changes=OFF'); + $dbh->do('PRAGMA journal_mode=MEMORY'); + $dbh->do('PRAGMA temp_store=MEMORY'); $dbh->do(<<'SQL'); CREATE TABLE unihan ( "hex" CHAR(5) NOT NULL,
Many thanks for the patch. applied. Thanks