[Dbix-class] dynamic class requires

Oleg Pronin syber.rus at gmail.com
Fri Dec 28 05:14:59 GMT 2007


Try perl 5.10.0. Your application should start very fast and use less memory
with 5.10.

2007/12/28, Lawrence Hochberg <lmh at intex.com>:
>
>
> We currently loaded hundreds of classes in our load_classes
> statement.  These classes in turn have many dependencies.  The end
> result is that the load_classes statement takes over a second to
> execute.  This would not be a problem for a long running perl
> program, but we use the schema functionality to handle short lived
> requests on a webserver.  Most of these requests only need to access
> a handful of tables, so it seems wasteful (read slow) to load all of
> the classes for every table in our database when only a couple are
> needed.  One possibility is to break up our tables into logical
> groups, but because of cross dependencies, this is not optimal from a
> maintenance point of view.  I am currently trying to hack in AUTOLOAD
> functionality, but if such a feature already exists, or there is a
> better approach, I'd appreciate the feedback.
>
> thank you for your help!
>
> Regards,
> lmh
>
>
> At 05:22 PM 12/27/2007, Ash Berlin wrote:
>
> >On 27 Dec 2007, at 20:37, Lawrence Hochberg wrote:
> >
> >>Hi
> >>
> >>Is there a way to dynamically require a class at the first
> >>instantiation of an instance as opposed to loading all classes
> >>upfront via load_classes?
> >>
> >>I am looking for similar functionality to the Class::Factory module
> >>methods add_factory_type and register_factory_type.
> >>
> >>Regards,
> >>lmh
> >
> >First things first: Why?
> >
> >_______________________________________________
> >List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> >IRC: irc.perl.org#dbix-class
> >SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> >Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.rawmode.org
> >
>
>
>
>
> _______________________________________________
> List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
> Searchable Archive:
> http://www.grokbase.com/group/dbix-class@lists.rawmode.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20071228/445=
41178/attachment.htm


More information about the DBIx-Class mailing list