You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Jason Tesser <ja...@gmail.com> on 2010/02/04 01:36:08 UTC
1.6.3 templates twice the size
I modified velocity code so that I can serialize templates in both 1.6.3 and
1.5.
in 1.5 the objects were like 88k are now 160k or so. The actual string
meaning text in the velocity template is only about 1k.
Any ideas? Can I reduce this? The size is getting out of control.
Thanks,
Jason Tesser
dotCMS Lead Development Manager
1-305-858-1422
Re: 1.6.3 templates twice the size
Posted by Nathan Bubna <nb...@gmail.com>.
On Fri, Mar 26, 2010 at 11:11 AM, Jason Tesser <ja...@gmail.com> wrote:
> I did manage to get them a bit smaller. 1k to about 38k on Disk.
That seems more reasonable.
> We are releasing our next version with a modified Velocity 1.6.3 which does
> serialize to disk. We use JBoss Cache for the caching layer. So basically
> everything lazy loads from the resource loader then all is cached even on
> restart :-) Huge for us as we can have millions of Velocity files in our
> system.
Sounds awesome.
> I would love to see Velocity allow Templates/Resources to be Serializable at
> some point. I was able to make it work in 1.6.3 in about 6 hours.
> The thing is though for us VelocityEngine is a Singleton so I expose him and
> get the Runtime services and all that way on Deserialization making all that
> stuff transient.
Yeah, there would need to be some way to tell the deserializing code
to use an arbitrary RuntimeInstance. If this could be done, it would
be pretty cool. I feel like someone started work on it many years
ago, but ultimately didn't find it worthwhile for their situation and
stopped. I would love to work with you on this, but given my
company's increasing shift to client-side code and my family's
increasing size, i have found myself with a correlating drop in time
for Velocity work. It is hard to overcome the logic of "but it's
already good enough for us". Still, are you able to share your
modified Velocity code? I'd be curious to at least take a look, and
others may be more able to work on it.
> Thanks,
> Jason Tesser
> dotCMS Lead Development Manager
> 1-305-858-1422
>
>
> On Fri, Mar 26, 2010 at 1:58 PM, Nathan Bubna <nb...@gmail.com> wrote:
>
>> That's very strange. A lot of work went into reducing memory (RAM)
>> usage and reducing CPU bottlenecks in 1.6. As far as i know, you are
>> the only one currently working to serialize templates. Without
>> knowing more about how you are modifying things to be serialized, it
>> is hard to say why they are taking so much more disk space now. I
>> don't believe the template object structure became that much more
>> complicated. I'd imagine that there are more internal references
>> that need to be made transient. I can't imagine that 160k of data is
>> needed to deserialize a 1k template string.
>>
>> On Wed, Feb 3, 2010 at 4:36 PM, Jason Tesser <ja...@gmail.com>
>> wrote:
>> > I modified velocity code so that I can serialize templates in both 1.6.3
>> and
>> > 1.5.
>> >
>> > in 1.5 the objects were like 88k are now 160k or so. The actual string
>> > meaning text in the velocity template is only about 1k.
>> >
>> > Any ideas? Can I reduce this? The size is getting out of control.
>> >
>> > Thanks,
>> > Jason Tesser
>> > dotCMS Lead Development Manager
>> > 1-305-858-1422
>> >
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
>> For additional commands, e-mail: user-help@velocity.apache.org
>>
>>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: 1.6.3 templates twice the size
Posted by Jason Tesser <ja...@gmail.com>.
I did manage to get them a bit smaller. 1k to about 38k on Disk.
We are releasing our next version with a modified Velocity 1.6.3 which does
serialize to disk. We use JBoss Cache for the caching layer. So basically
everything lazy loads from the resource loader then all is cached even on
restart :-) Huge for us as we can have millions of Velocity files in our
system.
I would love to see Velocity allow Templates/Resources to be Serializable at
some point. I was able to make it work in 1.6.3 in about 6 hours.
The thing is though for us VelocityEngine is a Singleton so I expose him and
get the Runtime services and all that way on Deserialization making all that
stuff transient.
Thanks,
Jason Tesser
dotCMS Lead Development Manager
1-305-858-1422
On Fri, Mar 26, 2010 at 1:58 PM, Nathan Bubna <nb...@gmail.com> wrote:
> That's very strange. A lot of work went into reducing memory (RAM)
> usage and reducing CPU bottlenecks in 1.6. As far as i know, you are
> the only one currently working to serialize templates. Without
> knowing more about how you are modifying things to be serialized, it
> is hard to say why they are taking so much more disk space now. I
> don't believe the template object structure became that much more
> complicated. I'd imagine that there are more internal references
> that need to be made transient. I can't imagine that 160k of data is
> needed to deserialize a 1k template string.
>
> On Wed, Feb 3, 2010 at 4:36 PM, Jason Tesser <ja...@gmail.com>
> wrote:
> > I modified velocity code so that I can serialize templates in both 1.6.3
> and
> > 1.5.
> >
> > in 1.5 the objects were like 88k are now 160k or so. The actual string
> > meaning text in the velocity template is only about 1k.
> >
> > Any ideas? Can I reduce this? The size is getting out of control.
> >
> > Thanks,
> > Jason Tesser
> > dotCMS Lead Development Manager
> > 1-305-858-1422
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
Re: 1.6.3 templates twice the size
Posted by Nathan Bubna <nb...@gmail.com>.
That's very strange. A lot of work went into reducing memory (RAM)
usage and reducing CPU bottlenecks in 1.6. As far as i know, you are
the only one currently working to serialize templates. Without
knowing more about how you are modifying things to be serialized, it
is hard to say why they are taking so much more disk space now. I
don't believe the template object structure became that much more
complicated. I'd imagine that there are more internal references
that need to be made transient. I can't imagine that 160k of data is
needed to deserialize a 1k template string.
On Wed, Feb 3, 2010 at 4:36 PM, Jason Tesser <ja...@gmail.com> wrote:
> I modified velocity code so that I can serialize templates in both 1.6.3 and
> 1.5.
>
> in 1.5 the objects were like 88k are now 160k or so. The actual string
> meaning text in the velocity template is only about 1k.
>
> Any ideas? Can I reduce this? The size is getting out of control.
>
> Thanks,
> Jason Tesser
> dotCMS Lead Development Manager
> 1-305-858-1422
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org