Skip Menu |

This queue is for tickets about the DBIx-Class CPAN distribution.

Report information
The Basics
Id: 106684
Status: stalled
Priority: 0/
Queue: DBIx-Class

People
Owner: Nobody in particular
Requestors: porton [...] narod.ru
Cc:
AdminCc:

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



Subject: Slow __PACKAGE__->load_namespaces;
Date: Thu, 27 Aug 2015 01:24:30 +0300
To: bug-DBIx-Class [...] rt.cpan.org
From: Victor Porton <porton [...] narod.ru>
__PACKAGE__->load_namespaces; is very slow (almost 2 sec) on our MySQL DB with 250 tables (and some tables have really many columns). The schema was generated with DBIx::Class::Schema::Loader It created 250 Result/*.pm files. It seems that load_namespaces loads all of them. You need to implement lazy loading. We throw away DBIx::Class and switch to Class::DBI. 2 sec is really too long. -- Victor Porton - http://portonvictor.org
Subject: Re: [rt.cpan.org #106684] Slow __PACKAGE__->load_namespaces;
Date: Thu, 27 Aug 2015 09:33:15 +0200
To: bug-DBIx-Class [...] rt.cpan.org
From: Peter Rabbitson <ribasushi [...] cpan.org>
On 08/27/2015 12:25 AM, Victor Porton via RT wrote: Show quoted text
> Wed Aug 26 18:25:20 2015: Request 106684 was acted upon. > Transaction: Ticket created by PORTON > Queue: DBIx-Class > Subject: Slow __PACKAGE__->load_namespaces; > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: porton@narod.ru > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=106684 > > > > __PACKAGE__->load_namespaces; is very slow (almost 2 sec) on our MySQL > DB with 250 tables (and some tables have really many columns). > > The schema was generated with > DBIx::Class::Schema::Loader > It created 250 Result/*.pm files. > > It seems that load_namespaces loads all of them. You need to implement > lazy loading.
This is indeed something that is a pain point. Implementing it is on the horizon, there are several related pieces that need to fall in place for this to be implemented cleanly (and to be useful to the already existing huge install base). Show quoted text
> We throw away DBIx::Class and switch to Class::DBI. 2 sec is really too > long.
You could implement loading on your own via ->load_classes, but bottom line is: If DBIC doesn't fit your workload - it doesn't fit your workload. Consider checking back with DBIC in about 6 months, see if it fits the bill beter. Thanks for the report, will keep this ticket stalled/wishlist. RT will notify you when its status changes.