Modifying Desert

1 view
Skip to first unread message

Andrei Erdoss

unread,
Mar 26, 2009, 6:55:05 AM3/26/09
to pivotallab...@googlegroups.com
Can Desert be modified to load files immediately instead of lazily?

--
Andrei Erdoss

Brian Takita

unread,
Mar 26, 2009, 1:51:46 PM3/26/09
to pivotallab...@googlegroups.com
On Thu, Mar 26, 2009 at 3:55 AM, Andrei Erdoss <erd...@gmail.com> wrote:
> Can Desert be modified to load files immediately instead of lazily?
Andrei, can you elaborate on what you mean by immediately?
Does this mean Desert will automatically load all models, controllers,
and lib files on project load/reload?
>
> --
> Andrei Erdoss
>
> >
>

Andrei Erdoss

unread,
Mar 26, 2009, 1:57:41 PM3/26/09
to pivotallab...@googlegroups.com
I might have the terminology wrong, but from your post, I got that Desert does lazy loading of files. From talking to the creator of Passenger, I gathered that lazy loading is not optimal to the performance of Passenger.

My question is, can Desert be modified to work better with Passenger? Thanks,
--
Andrei Erdoss

Brian Takita

unread,
Mar 26, 2009, 2:29:37 PM3/26/09
to pivotallab...@googlegroups.com
On Thu, Mar 26, 2009 at 10:57 AM, Andrei Erdoss <erd...@gmail.com> wrote:
> I might have the terminology wrong, but from your post, I got that Desert
> does lazy loading of files. From talking to the creator of Passenger, I
> gathered that lazy loading is not optimal to the performance of Passenger.
>
> My question is, can Desert be modified to work better with Passenger?
> Thanks,
Perhaps Desert can have an option to have eager loading, which will
load the models, controllers, and lib files.
We can even detect if the process is running from Passenger, and by
default, do eager loading.

Andrei Erdoss

unread,
Mar 26, 2009, 2:56:43 PM3/26/09
to pivotallab...@googlegroups.com
On Thu, Mar 26, 2009 at 8:29 PM, Brian Takita <br...@pivotallabs.com> wrote:

On Thu, Mar 26, 2009 at 10:57 AM, Andrei Erdoss <erd...@gmail.com> wrote:
> I might have the terminology wrong, but from your post, I got that Desert
> does lazy loading of files. From talking to the creator of Passenger, I
> gathered that lazy loading is not optimal to the performance of Passenger.
>
> My question is, can Desert be modified to work better with Passenger?
> Thanks,
Perhaps Desert can have an option to have eager loading, which will
load the models, controllers, and lib files.
We can even detect if the process is running from Passenger, and by
default, do eager loading.
Would something like this be difficult to implement?
 

>
> On Thu, Mar 26, 2009 at 7:51 PM, Brian Takita <br...@pivotallabs.com> wrote:
>>
>> On Thu, Mar 26, 2009 at 3:55 AM, Andrei Erdoss <erd...@gmail.com> wrote:
>> > Can Desert be modified to load files immediately instead of lazily?
>> Andrei, can you elaborate on what you mean by immediately?
>> Does this mean Desert will automatically load all models, controllers,
>> and lib files on project load/reload?
>> >
>> > --
>> > Andrei Erdoss
>> >
>> > >
>> >
>>
>>
>
>
>
> --
> Andrei Erdoss
>
> >
>





--
Andrei Erdoss

Brian Takita

unread,
Mar 28, 2009, 10:42:15 PM3/28/09
to pivotallab...@googlegroups.com
On Thu, Mar 26, 2009 at 11:56 AM, Andrei Erdoss <erd...@gmail.com> wrote:
>
>
> On Thu, Mar 26, 2009 at 8:29 PM, Brian Takita <br...@pivotallabs.com> wrote:
>>
>> On Thu, Mar 26, 2009 at 10:57 AM, Andrei Erdoss <erd...@gmail.com> wrote:
>> > I might have the terminology wrong, but from your post, I got that
>> > Desert
>> > does lazy loading of files. From talking to the creator of Passenger, I
>> > gathered that lazy loading is not optimal to the performance of
>> > Passenger.
>> >
>> > My question is, can Desert be modified to work better with Passenger?
>> > Thanks,
>> Perhaps Desert can have an option to have eager loading, which will
>> load the models, controllers, and lib files.
>> We can even detect if the process is running from Passenger, and by
>> default, do eager loading.
>
> Would something like this be difficult to implement?
I just released Desert version 0.4.1. This version of Desert included
eager loading.

To use eager loading, add
Desert::Manager.require_all_files in your environment.rb file.

I also added Desert::Manager.all_files, which returns an array of all
of the files on the Desert load path.

Andrei Erdoss

unread,
Mar 29, 2009, 11:12:19 AM3/29/09
to pivotallab...@googlegroups.com
Wow. This is awesome. Thank you.

I will incorporated these changes into my app and I will do some testing.

All the best,
--
Andrei Erdoss

Andrei Erdoss

unread,
Apr 22, 2009, 11:00:46 AM4/22/09
to pivotallab...@googlegroups.com
Brian,

Thanks for your hard work. I finally got around trying out Desert::Manager.require_all_files  but I am getting:  undefined method `namespace' for main:Object (NoMethodError) What do you think might cause this?

Thanks,

Andrei
--
Andrei Erdoss
Reply all
Reply to author
Forward
0 new messages