Re: [ANN] pysqlite 2.1.0 released



Alex Martelli wrote:
Gerhard Häring <gh@xxxxxxxxxxx> wrote:
   ...

An optimized shortcut has been enabled to retrieve Unicode strings for
non-ASCII data, but bytestrings for non-ASCII text:

con.text_factory = sqlite.OptimizedUnicode


I assume you mean "ASCII text" rather than "non-ASCII text" here?

You're right. I stole this idea from APSW, another SQLite wrapper, which does this by default in order to reduce memory usage and increase performance a little bit for the common use case of ASCII text.


You might argue that that this is premature optimization, but things like this do make a difference if you process a lot of text.

Using this feature should be pretty compatible to the default of always using Unicode, because `unicode` and `str` have pretty much the same interface. But I wasn't 100 % sure, so I kept the old pysqlite default of Unicode only and made the optimized case using OptimizedUnicode an option.

At any rate, my compliments for a new release (which looks great!) of a
most excellent module!

Thanks :-)

-- Gerhard
.



Relevant Pages

  • Re: Distance point <=> straight line in space
    ... k' => the offset of the line as it crosses the x axis ... One optimization that avoids the problems of the line slope tending to ... If the lines share some common feature (such as ...
    (comp.programming)
  • Re: Distance point <=> straight line in space
    ... k' => the offset of the line as it crosses the x axis ... One optimization that avoids the problems of the line slope tending to ... If the lines share some common feature (such as ...
    (comp.programming)
  • [PATCH] fix f_version optimization for get_tgid_list
    ... the kernel contains an optimization that skips the linked list walk in ... get_tgid_list for the common case of sequential accesses. ... Unfortunately the optimization is buggy (missing NULL pointer check for ... could you run your 100k processes test against a kernel with this ...
    (Linux-Kernel)
  • Re: Why forth is not popular
    ... What he says is "common knowledge" even though a lot of it's based on incorrect or incomplete information. ... lovingly kept in working order by their owners, ... replaced with Unicode. ... respect to today's Forth technology and the areas in which it's being used. ...
    (comp.lang.forth)
  • Re: In HashMap.put, "if (e.hash == hash && eq(k, e.key))" ?
    ... > The extra test is an optimization for a common case, ... > fast operation compared to invoking equals() on each of the keys. ...
    (comp.lang.java.programmer)