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.