On Wed, Oct 16, 2013 at 7:51 AM, Mike Clagett <mike.clag...@mathworks.com>wrote:
> Hi - > > We have a C++ (VisualC++) app that is reading from and writing to a sqlite > database. Profiling reveals that it is spending 883.437 of its 2160.988 > seconds in the sqlite3_win32_mbcs_to_utf8 function. Wow. That routine should only be called when (1) reporting a low-level I/O error and (2) creating a temporary filename. And both of those should be rare occurrences. 1. What does your profiler say is the most frequent caller to sqlite3_win32_mbcs_to_utf8()? 2. Have you enabled error logging? (http://www.sqlite.org/errlog.html) 3. Have you tried running with PRAGMA temp_store=MEMORY to see if that helps? 4. Please tell us which MathWorks products us SQLite, so that we can add them to http://www.sqlite.org/famous.html > We are using std::basic_string<wchar_t,...> as our string type and I can > only assume that these are being seen by sqlite as mbcs strings. No. The problem is that SQLite uses UTF8 for filenames and Windows uses MBCS for filenames and so we have to convert between the two when making Windows system calls such as opening new files. > I would like to know a better way of doing this that will eliminate all > these unnecessary conversions. I believe it may end up being a > combination of picking the correct string type (although using anything but > the type we are using may be difficult if it contravenes a product-wide > standard) and setting the defaults properly in sqlite. I have attempted > the latter by issuing a m_db.executeStatement("PRAGMA encoding = > \"UTF-16\"", error); just after I create a database. I clearly am not > doing this effectively as it seems to have no effect on the use of the > function in question. > > Any guidance from older hands would be greatly appreciated. > > Thanks. > > Michael Clagett > Principal Software Engineer > Mathworks, Inc. > mike.clag...@mathworks.com<mailto:mike.clag...@mathworks.com> > (508)-647-4307 > > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users