Discussion:
Good, free profiling?
Howard M. Lewis Ship
2003-01-02 04:03:24 UTC
Permalink
Is there a good, free (and/or open source) profiling tool?

Tapestry 2.4 performance may be slipping a little; I can't tell because I
don't have access to any profiling tools. Luis Neves has previously
commented that the bottleneck he observes is in character-to-byte
conversions, deep inside java.io. I'm now concerned that all the cool 2.4
features such as dynamic page and component discovery are also eating up too
many cycles (especially when a page is first loaded). Also, I'm getting
concerned about inneficient threading, since there are more chunks of
Tapestry that must be synchronized.

The new page persistance stuff is working well, though its a bit more picky
about what types of objects are allowed as persitent properties. Each
persistant page property is now stored individually in the HttpSession. The
engine now only stores a list of pages with persistent properties.

The basic types, such as String, Number, Boolean work fine. It
differentiates between mutable and immutable objects. Immutable objects are
String, Number, Boolean, java.util.Date (which is slightly fudging), Enum
and anything marked as IImmutable (a new marker interface for immutable
objects).

Mutable objects are tougher since the persistance wants to keep an isolated
copy of properties. That is, fireObservedChange() results in a copy being
made, and when a page is rolled back in a later request cycle, a copy (of
the copy) is made.

It's less efficient, but it means no surprises, especially in a clustered
environment. It forces the user to be careful about setting values, you
must follow a get/modify/set pattern, no fudging. It's also going to help
with some timing issues that occur when multiple requests against the same
engine run concurrently ... triggered by frames, but also by private assets.

The problem is handling the copying of values. At best, its going to do a
shallow copy. As a last resort, Serializable objects are serialized and
deserialzed (to make a deep copy).

Individual classes or interfaces need their own handler (IValueCopier)
registered with a IValuePersister. The good news is this provides a clean
way to handle things like EJBObject (which is now converted to an
EJBObjectWrapper, which implements Serializable to read and write the
object's handle).

However, for mutable objects like List, a specific handler must be created,
i.e.:

public class ListCopier implements IValueCopier
{
public Object makeCopyOfValue(Object value)
{
List list = (List)value;
return new ArrayList(list);
}
}

I think this is the right course to pursue, but I'm concerned that the
framework will get finicky.

Status: 22,440 NCLOC, 70.5% coverage

----
Howard Lewis Ship
hlship-***@public.gmane.org
http://tapestry.sf.net



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Malcolm Edgar
2003-01-02 05:34:51 UTC
Permalink
Hi Howard,

I don't know of any free profiling tool. I have found JProbe is a great
tool. I think someone once said we should pool some dollars to buy this for
you/Tapestry, I can kick in some Aussie dollars (for what they are worth).

Do you have any thoughts on whether the Global object should be included in
2.3 or 2.4?

regards Malcolm
Subject: [Tapestry-contrib] Good, free profiling?
Date: Wed, 1 Jan 2003 23:03:24 -0500
Is there a good, free (and/or open source) profiling tool?
Tapestry 2.4 performance may be slipping a little; I can't tell because I
don't have access to any profiling tools. Luis Neves has previously
commented that the bottleneck he observes is in character-to-byte
conversions, deep inside java.io. I'm now concerned that all the cool 2.4
features such as dynamic page and component discovery are also eating up
too
many cycles (especially when a page is first loaded). Also, I'm getting
concerned about inneficient threading, since there are more chunks of
Tapestry that must be synchronized.
The new page persistance stuff is working well, though its a bit more picky
about what types of objects are allowed as persitent properties. Each
persistant page property is now stored individually in the HttpSession.
The
engine now only stores a list of pages with persistent properties.
The basic types, such as String, Number, Boolean work fine. It
differentiates between mutable and immutable objects. Immutable objects
are
String, Number, Boolean, java.util.Date (which is slightly fudging), Enum
and anything marked as IImmutable (a new marker interface for immutable
objects).
Mutable objects are tougher since the persistance wants to keep an isolated
copy of properties. That is, fireObservedChange() results in a copy being
made, and when a page is rolled back in a later request cycle, a copy (of
the copy) is made.
It's less efficient, but it means no surprises, especially in a clustered
environment. It forces the user to be careful about setting values, you
must follow a get/modify/set pattern, no fudging. It's also going to help
with some timing issues that occur when multiple requests against the same
engine run concurrently ... triggered by frames, but also by private
assets.
The problem is handling the copying of values. At best, its going to do a
shallow copy. As a last resort, Serializable objects are serialized and
deserialzed (to make a deep copy).
Individual classes or interfaces need their own handler (IValueCopier)
registered with a IValuePersister. The good news is this provides a clean
way to handle things like EJBObject (which is now converted to an
EJBObjectWrapper, which implements Serializable to read and write the
object's handle).
However, for mutable objects like List, a specific handler must be created,
public class ListCopier implements IValueCopier
{
public Object makeCopyOfValue(Object value)
{
List list = (List)value;
return new ArrayList(list);
}
}
I think this is the right course to pursue, but I'm concerned that the
framework will get finicky.
Status: 22,440 NCLOC, 70.5% coverage
----
Howard Lewis Ship
http://tapestry.sf.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-contrib mailing list
https://lists.sourceforge.net/lists/listinfo/tapestry-contrib
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Viktor Szathmary
2003-01-02 06:01:36 UTC
Permalink
Post by Malcolm Edgar
Hi Howard,
I don't know of any free profiling tool. I have found JProbe is a
great tool. I think someone once said we should pool some dollars to
buy this for you/Tapestry, I can kick in some Aussie dollars (for what
they are worth).
if you're using unix, i found this to be pretty quick, and useful:
http://www.khelekore.org/jmp/ - i just noticed they seem to have a
windows build too now (http://www.khelekore.org/jmp/winbuild.html)...

i used jprobe too, it's very nice to work with, but i found jmp to be
somewhat quicker...

viktor





-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Howard M. Lewis Ship
2003-01-02 11:45:45 UTC
Permalink
Post by Malcolm Edgar
Do you have any thoughts on whether the Global object should be included in
2.3 or 2.4?
2.4

2.4 is not that far off, given the head start we have on it. I'd rather we
put 2.3 to bed as soon as possible.
Post by Malcolm Edgar
regards Malcolm
Subject: [Tapestry-contrib] Good, free profiling?
Date: Wed, 1 Jan 2003 23:03:24 -0500
Is there a good, free (and/or open source) profiling tool?
Tapestry 2.4 performance may be slipping a little; I can't tell because I
don't have access to any profiling tools. Luis Neves has previously
commented that the bottleneck he observes is in character-to-byte
conversions, deep inside java.io. I'm now concerned that all the cool 2.4
features such as dynamic page and component discovery are also eating up
too
many cycles (especially when a page is first loaded). Also, I'm getting
concerned about inneficient threading, since there are more chunks of
Tapestry that must be synchronized.
The new page persistance stuff is working well, though its a bit more picky
about what types of objects are allowed as persitent properties. Each
persistant page property is now stored individually in the HttpSession.
The
engine now only stores a list of pages with persistent properties.
The basic types, such as String, Number, Boolean work fine. It
differentiates between mutable and immutable objects. Immutable objects
are
String, Number, Boolean, java.util.Date (which is slightly fudging), Enum
and anything marked as IImmutable (a new marker interface for immutable
objects).
Mutable objects are tougher since the persistance wants to keep an isolated
copy of properties. That is, fireObservedChange() results in a copy being
made, and when a page is rolled back in a later request cycle, a copy (of
the copy) is made.
It's less efficient, but it means no surprises, especially in a clustered
environment. It forces the user to be careful about setting values, you
must follow a get/modify/set pattern, no fudging. It's also going to help
with some timing issues that occur when multiple requests against the same
engine run concurrently ... triggered by frames, but also by private
assets.
The problem is handling the copying of values. At best, its going to do a
shallow copy. As a last resort, Serializable objects are serialized and
deserialzed (to make a deep copy).
Individual classes or interfaces need their own handler (IValueCopier)
registered with a IValuePersister. The good news is this provides a clean
way to handle things like EJBObject (which is now converted to an
EJBObjectWrapper, which implements Serializable to read and write the
object's handle).
However, for mutable objects like List, a specific handler must be created,
public class ListCopier implements IValueCopier
{
public Object makeCopyOfValue(Object value)
{
List list = (List)value;
return new ArrayList(list);
}
}
I think this is the right course to pursue, but I'm concerned that the
framework will get finicky.
Status: 22,440 NCLOC, 70.5% coverage
----
Howard Lewis Ship
http://tapestry.sf.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-contrib mailing list
https://lists.sourceforge.net/lists/listinfo/tapestry-contrib
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Viktor Szathmary
2003-01-02 15:03:16 UTC
Permalink
hi,
Post by Howard M. Lewis Ship
Post by Howard M. Lewis Ship
The basic types, such as String, Number, Boolean work fine. It
differentiates between mutable and immutable objects. Immutable objects
are
String, Number, Boolean, java.util.Date (which is slightly fudging), Enum
and anything marked as IImmutable (a new marker interface for immutable
objects).
Mutable objects are tougher since the persistance wants to keep an
isolated
Post by Howard M. Lewis Ship
copy of properties. That is, fireObservedChange() results in a copy
being
Post by Howard M. Lewis Ship
made, and when a page is rolled back in a later request cycle, a copy (of
the copy) is made.
The problem is handling the copying of values. At best, its going to do
a
Post by Howard M. Lewis Ship
shallow copy. As a last resort, Serializable objects are serialized and
deserialzed (to make a deep copy).
I think exposing the pooling that has to happen inside tapestry to the
average component developer is a mistake. It just opens up a way of
shooting yourself in the foot, while giving very little advantage to app
developers in general. And it seems now in order to make the semantics
less confusing, you have to add more expensive and complicated behavior
(copying) to the framework... Now I do agree that the pooling of
expensive resources (templates, bindings, whatever else) is a goood
thing... however, i would separate it in two: make components non-pooled
and recreated all the time, and separate out the heavyweight portion into
another class that does need to know about pooling. The lightweight
component should delegate to the pooled instance when needed (Tapestry
should estabilish the association between it and the peer).

eg. so a request could go somewhat like this:

Component c = ... // new instance
ComponentPeer p = pool.getPeer(c);
c.setPeer( p );
// perform request...
p.detach()
c = null; // just forget about it...
pool.returnPeer(p);

I think this would make developers have to think about a lot less
"issues" that really have nothing to do with their application logic,
only how the framework is built. Writing components would become more
natural - you can use regular constructors and forget about detach and
it's sideffects.

i hope this doesnt sound much sillier or less efficient than an intricate
copying solution with special handling for immutables :)

best regards,
viktor
--
phraktle-***@public.gmane.org
--
http://fastmail.fm - Email service worth paying for. Try it for free


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Malcolm Edgar
2003-01-03 11:28:25 UTC
Permalink
Hi Howard,

the US/Aust time difference is catching me out here, as I had already
checked the Global stuff in before I got your answer. Next time I will wait
a little longer. Its pretty non-obstrusive/simple stuff, so I cant see it
causing any problems.

regards Malcolm
To: "Malcolm Edgar"
Subject: Re: [Tapestry-contrib] Good, free profiling?
Date: Thu, 2 Jan 2003 06:45:45 -0500
Post by Malcolm Edgar
Do you have any thoughts on whether the Global object should be included
in
Post by Malcolm Edgar
2.3 or 2.4?
2.4
2.4 is not that far off, given the head start we have on it. I'd rather we
put 2.3 to bed as soon as possible.
Post by Malcolm Edgar
regards Malcolm
Subject: [Tapestry-contrib] Good, free profiling?
Date: Wed, 1 Jan 2003 23:03:24 -0500
Is there a good, free (and/or open source) profiling tool?
Tapestry 2.4 performance may be slipping a little; I can't tell because
I
Post by Malcolm Edgar
don't have access to any profiling tools. Luis Neves has previously
commented that the bottleneck he observes is in character-to-byte
conversions, deep inside java.io. I'm now concerned that all the cool
2.4
Post by Malcolm Edgar
features such as dynamic page and component discovery are also eating
up
Post by Malcolm Edgar
too
many cycles (especially when a page is first loaded). Also, I'm
getting
Post by Malcolm Edgar
concerned about inneficient threading, since there are more chunks of
Tapestry that must be synchronized.
The new page persistance stuff is working well, though its a bit more
picky
Post by Malcolm Edgar
about what types of objects are allowed as persitent properties. Each
persistant page property is now stored individually in the HttpSession.
The
engine now only stores a list of pages with persistent properties.
The basic types, such as String, Number, Boolean work fine. It
differentiates between mutable and immutable objects. Immutable
objects
Post by Malcolm Edgar
are
String, Number, Boolean, java.util.Date (which is slightly fudging),
Enum
Post by Malcolm Edgar
and anything marked as IImmutable (a new marker interface for immutable
objects).
Mutable objects are tougher since the persistance wants to keep an
isolated
Post by Malcolm Edgar
copy of properties. That is, fireObservedChange() results in a copy
being
Post by Malcolm Edgar
made, and when a page is rolled back in a later request cycle, a copy
(of
Post by Malcolm Edgar
the copy) is made.
It's less efficient, but it means no surprises, especially in a
clustered
Post by Malcolm Edgar
environment. It forces the user to be careful about setting values,
you
Post by Malcolm Edgar
must follow a get/modify/set pattern, no fudging. It's also going to
help
Post by Malcolm Edgar
with some timing issues that occur when multiple requests against the
same
Post by Malcolm Edgar
engine run concurrently ... triggered by frames, but also by private
assets.
The problem is handling the copying of values. At best, its going to
do
a
Post by Malcolm Edgar
shallow copy. As a last resort, Serializable objects are serialized
and
Post by Malcolm Edgar
deserialzed (to make a deep copy).
Individual classes or interfaces need their own handler (IValueCopier)
registered with a IValuePersister. The good news is this provides a
clean
Post by Malcolm Edgar
way to handle things like EJBObject (which is now converted to an
EJBObjectWrapper, which implements Serializable to read and write the
object's handle).
However, for mutable objects like List, a specific handler must be
created,
Post by Malcolm Edgar
public class ListCopier implements IValueCopier
{
public Object makeCopyOfValue(Object value)
{
List list = (List)value;
return new ArrayList(list);
}
}
I think this is the right course to pursue, but I'm concerned that the
framework will get finicky.
Status: 22,440 NCLOC, 70.5% coverage
----
Howard Lewis Ship
http://tapestry.sf.net
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-contrib mailing list
https://lists.sourceforge.net/lists/listinfo/tapestry-contrib
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Tapestry-contrib mailing list
https://lists.sourceforge.net/lists/listinfo/tapestry-contrib
_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

Continue reading on narkive:
Loading...