Skip Menu |
 

This queue is for tickets about the DBD-SQLite CPAN distribution.

Report information
The Basics
Id: 44884
Status: resolved
Priority: 0/
Queue: DBD-SQLite

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

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



Subject: Avoid use of DBIS macro in driver internals
Download (untitled) / with headers
text/plain 956b
Avoid use of DBIS macro in driver internals because it's very slow on perls configured with threading enabled (which is the case on most linux distributions). http://search.cpan.org/grep?cpanid=ADAMK&release=DBD-SQLite-1.22_02&string=DBIS- %3E&F=1&n=1&C=0 Replace with DBIc_DBISTATE(imp_xxh) in the general case. For DBIS->debug you should use DBIc_TRACE(imp_xxh, flags, flaglevel, level). See DBIXS.h for details. To make those changes you may need to pass the imp_xxh struct pointer into functions. (Passing both SV *h, the handle, and imp_xxh is recommended). While you're doing that, you should also aim to eliminate use of dTHR. That's also expensive and occurs frequently in the code: http://search.cpan.org/grep?cpanid=ADAMK&release=DBD-SQLite- 1.22_02&string=dTHR&F=1&n=1&C=0 Fix that by adding pTHX_ as the first param (with no trailing comma) of the function that calls dTHR, and adding aTHX_ as the first argument in all the calls.
Download (untitled) / with headers
text/plain 1.2k
On Wed Apr 08 18:15:19 2009, TIMB wrote: Show quoted text
> Avoid use of DBIS macro in driver internals because it's very slow on > perls configured with > threading enabled (which is the case on most linux distributions). > > http://search.cpan.org/grep?cpanid=ADAMK&release=DBD-SQLite- > 1.22_02&string=DBIS- > %3E&F=1&n=1&C=0 > > Replace with DBIc_DBISTATE(imp_xxh) in the general case.
The only non-debug DBIS usage is in the init function, where there is no imp_xxh. void sqlite_init(dbistate_t *dbistate) { dTHR; DBIS = dbistate; } How should this be converted? Show quoted text
> For DBIS->debug you should use DBIc_TRACE(imp_xxh, flags, flaglevel, > level). See DBIXS.h > for details. > > To make those changes you may need to pass the imp_xxh struct pointer > into functions. > (Passing both SV *h, the handle, and imp_xxh is recommended). > > While you're doing that, you should also aim to eliminate use of dTHR. > That's also expensive > and occurs frequently in the code: > > http://search.cpan.org/grep?cpanid=ADAMK&release=DBD-SQLite- > 1.22_02&string=dTHR&F=1&n=1&C=0 > > Fix that by adding pTHX_ as the first param (with no trailing comma) > of the function that > calls dTHR, and adding aTHX_ as the first argument in all the calls. >
Can you provide an example conversion of one of the uses? Adam K
CC: TIMB [...] cpan.org
Subject: Re: [rt.cpan.org #44884] Avoid use of DBIS macro in driver internals
Date: Thu, 9 Apr 2009 13:49:41 +0100
To: Adam Kennedy via RT <bug-DBD-SQLite [...] rt.cpan.org>
From: Tim Bunce <Tim.Bunce [...] pobox.com>
Download (untitled) / with headers
text/plain 767b
On Wed, Apr 08, 2009 at 08:23:14PM -0400, Adam Kennedy via RT wrote: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=44884 > > > The only non-debug DBIS usage is in the init function, where there is no > imp_xxh. > > void > sqlite_init(dbistate_t *dbistate) > { > dTHR; > DBIS = dbistate; > } > > How should this be converted?
If DBIS is no longer used it can be deleted. That's good. Show quoted text
> > Fix that by adding pTHX_ as the first param (with no trailing comma) > > of the function that > > calls dTHR, and adding aTHX_ as the first argument in all the calls.
> > Can you provide an example conversion of one of the uses?
See DBI source code for lots of examples of their use. Ask on dbi-dev@perl perl5-porters@perl.org for more help. Tim.
Download (untitled) / with headers
text/plain 1010b
I think this is (almost) fixed in 1.22_04 (except for the ones related to the func, for which we're waiting for a new DBI). On Thu, Apr 09 08:50:00 2009, Tim.Bunce@pobox.com wrote: Show quoted text
> On Wed, Apr 08, 2009 at 08:23:14PM -0400, Adam Kennedy via RT wrote:
> > <URL: https://rt.cpan.org/Ticket/Display.html?id=44884 > > > > > The only non-debug DBIS usage is in the init function, where there
is no Show quoted text
> > imp_xxh. > > > > void > > sqlite_init(dbistate_t *dbistate) > > { > > dTHR; > > DBIS = dbistate; > > } > > > > How should this be converted?
> > If DBIS is no longer used it can be deleted. That's good. >
> > > Fix that by adding pTHX_ as the first param (with no trailing
comma) Show quoted text
> > > of the function that > > > calls dTHR, and adding aTHX_ as the first argument in all the
calls. Show quoted text
> > > > Can you provide an example conversion of one of the uses?
> > See DBI source code for lots of examples of their use. Ask on > dbi-dev@perl perl5-porters@perl.org for more help. > > Tim.
Resolved


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.