Tagging speed improvements for Darktable (brought to you by DTrace)

Over the last few weeks I’ve been doing a bit of hacking on Darktable‘s tag suggestion code, because it is a significant usability pain point for me.

A few weeks back I wrote a post published on the Darktable.org blogabout how easy it is to be the maintainer of this application for Solaris. I also mentioned a DTrace one-liner I’d fired up to see what was going on with tag suggestions. From that one-liner my little bit of DTrace quickly escalated into variations of this:

#!/usr/sbin/dtrace -s
    self->traced = 1;

    self->traced = 0;

    self->sqlt = vtimestamp;
    self->sql = copyinstr(arg1);

    printf("sqlite \"%s\" took %d nsec",
        self->sql, vtimestamp - self->sqlt);
    self->sqlt = 0;