Re: profiling technology?

From: Holger Hoffstätte (holge..izards.de)
Date: Sat Mar 08 2003 - 16:07:04 EST

  • Next message: Holger Hoffstätte: "Weird bug related to batching"

    Arndt Brenschede wrote:
    > What about profiling? How do you,
    > or do you at all?

    Yes, I once took a peek with OptimizeIt but that was long ago. It's just
    not a prority at the moment, simply because there are too many other
    things to do. The new ContextCommit stuff is working (although I think I
    just found some bugs related to batching) and that was the most important
    part for beta-1, besides new DbAdaptors like PostgreSQL and HSQL.

    Also I can readily see many places that need optimizing without any
    profiler..but that is nothing we should change before beta-1 or maybe even
    1.0 final, since some optimizations have far-reaching effects and these
    need to be tested well against subtle regressions.

    > I just recently did some profiling
    > on my cayenne based proof-of-concept,
    > using my favoured profiling tool,

    Which one? I have OptimizeIt and the free eclipse plugin
    (http://eclipsecolorer.sourceforge.net/).

    > and the hotspots really come out nice.

    yup..they are not really subtle at the moment :-)

    > The java-side cpu-consumption overall
    > is dominated by the Collection stuff, and
    > also the most prominent hotspots are
    > about collection processing:

    yes. many things are currently copied, iterated and recreated over and
    over again; this adds up. getDbEntitiesAsList(),
    getObjAttributeForDbAttribute(), getPrimaryKeys() are cheap and obvious
    candidates for optimization..when the time has come. Just today I did a
    little trick that makes the ObjectId's map smaller by using not a HashMap
    for single pks (likely 95% of all cases) at all but rather a simple
    SingletonMap, which is a lot smaller and faster for all operations. This
    could be taken *much* further, just like e.g. DataObject
    fetching/creation, but would also have consequences for some of the APIs
    (e.g. deprecating constructors, introducing new ones etc.) and that simply
    takes time. Stabilizing some of the features that we have now is more
    important, and I can really understand that Andrus still wants to see his
    baby go gold this year. :^)

    > 2 of them are:
    >
    > - the constructor of "PrimaryKeyGenerationSupport"
    > which is called from the "DataContext" constructor
    > and accounts for 90% of the cost of DataContext-creation

    yes, I've seen that already. It's one of those things that are brand new.

    > - ObjEntity.getAttributeForDbAttribute(..)

    That (and everything 'below' the call stack) is one of those obvious
    candicates that I mentioned. I have a long list of such candidates; fixing
    one usually has a large acceleration effect since hotspots mostly work as
    factors.

    > It's an easy game to find these hotspots - looking
    > at the profile graph is like using a night vision device.

    8-)

    > I guess you could boost the cpu-performance of cayenne
    > by a factor of something by just addressing the top-ten
    > hotspots - any plans :-) ? Anybody need advice on profiling tools?

    Not me, I do performance tuning for a job. I could use more time, though.
    :)

    Holger



    This archive was generated by hypermail 2.0.0 : Sat Mar 08 2003 - 16:10:37 EST