a OSS benchmarking tool would be cool but i'm unlikely to be able to
find the cycles to help you out... 

providing that you're an ASF committer and happy licensing under ASL2,
then the sandbox can be a useful place to start out a project (whether
it ends up in the commons proper or not). 

- robert

On Wed, 2005-02-09 at 20:32, Kevin A. Burton wrote:
> A problem I'm having at work right now is that I need a simple 
> benchmarking tool across multiple libraries.  The FeedParser is a good 
> example because I want to link to the code there but also in our 
> internal code which also has some intregration with our DB.
> 
> This way I can look at a histograph of operations per second and how all 
> of the systems interact.
> 
> I wrote a simple prototype and here's the javadoc:
> 
> > /** * Benchmark that allows cheap and lightweight "benchmarking" (go 
> > figure) of * arbitrary code. All you have to do is call inc() every 
> > time a method * completes which will then increment the benchmark and 
> > perform any operations * necessary to maintain the benchmark. * * This 
> > class is lightweight (only requires a hashmap entry, and (24 bytes per 
> > * benchmark) of storage with no external requirements. This class is 
> > also * threadsafe so if you need to call this from multithreaded code 
> > to benchmark * the you'll be ok. * * The benchmark is maintained as 
> > number of inc()s per minute. This can be any * type of operation you 
> > want. Technically the interval can be longer than a * minute but we 
> > will end up with stale data. That's the tradeoff with this * type of 
> > benchmark. Its cheap and easy to maintain but anything more than 60 * 
> > seconds worth of data and you'll end up with a stale benchmark. * * 
> > Internally we use an incremented value which is accumulated and reset 
> > ever 60 * seconds. When we reset the benchmark we reset the current 
> > value so that we * can start accumulating again. * * @author <a 
> > href="mailto:[EMAIL PROTECTED]">Kevin Burton</a> * @version $Id: 
> > Adler32.java,v 1.4 2004/05/21 22:21:32 burton Exp $ */ 
> 
> 
> Now it dawned on me that if this was OSS that it could be used similar to 
> log4j.  One could integrate this with log4j to have it log its operations 
> every 60 seconds so that you could enable logging of benchmark information if 
> you're trying to debug performance.
> 
> It would also allow constructs such as:
> 
> Benchmark benchmark = Benchmark.getBenchmark( Foo.class );
> 
> try {
> 
>     benchmark.enter();
> 
>     //perform some slow complicated operation
> 
> } finally {
>     benchmark.exit();
> }
> 
> Then I could enable the benchmarks logging at runtime.  Since the benchmarks 
> only require 100 bytes or so (with hashmap overhead) one could add 
> benchmarking anywhere they wanted without much of a VM overhead.
> 
> Anyway... my NYE resolution was to make sure all of my util code becomes OSS 
> ;)..  Any interest in having this move into the sandbox or collaborating in 
> this somewhere?
> 
> Assuming there's interest that is.  I need it for work so I'll probably work 
> on a proof of concept ASAP ... 
> 
> Kevin


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to