telenths / protostuff

Automatically exported from code.google.com/p/protostuff
Apache License 2.0
0 stars 0 forks source link

Unable to run benchmark from command line #61

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
After `mvn install` in the project root I tried to execute benchmark.

README says I need to execute "java -Dbenchmark.output_dir=. -jar 
protostuff-benchmark-1.0-SNAPSHOT-jar-with-dependencies.jar" but in fact there 
is only "protostuff-benchmark-1.0.0.jar" after build in target folder.

But when running "java -Dbenchmark.output_dir=. -jar 
protostuff-benchmark-1.0.0.jar" I get exception

Exception in thread "main" java.lang.RuntimeException
        at com.dyuproject.protostuff.benchmark.BenchmarkRunner.<init>(BenchmarkRunner.java:42)
        at com.dyuproject.protostuff.benchmark.BenchmarkMain.main(BenchmarkMain.
java:31)

But somehow I could start it from IDEA IDE just by running main class. I guess 
this is because no dependencies are built into "protostuff-benchmark-1.0.0.jar" 
(it's 193661 bytes now)?

My platform is Windows, java is 1.6_24.

Original issue reported on code.google.com by Vladisla...@gmail.com on 1 Apr 2011 at 7:45

GoogleCodeExporter commented 8 years ago
I had to turn on "jwd" profile option in IDEA and build 
protostuff-benchmark-1.0.0-jar-with-dependencies.jar from IDE. But still by 
executing it from command line "java -Dbenchmark.output_dir=. -jar 
protostuff-benchmark-1.0.0-jar-with-dependencies.jar" I only get 

Exception in thread "main" java.lang.RuntimeException
        at com.dyuproject.protostuff.benchmark.BenchmarkRunner.<init>(BenchmarkRunner.java:42)
        at com.dyuproject.protostuff.benchmark.BenchmarkMain.main(BenchmarkMain.java:31)

Original comment by Vladisla...@gmail.com on 1 Apr 2011 at 8:21

GoogleCodeExporter commented 8 years ago
Yea seems like a bug.
I actually dont run the benchmark this way.  I use the jwd profile to use the 
output for generating a jarjar build.

The other way you can run the benchmark from command line is via:

mvn -DforkMode=never -Dtest=Bench* test

Original comment by david.yu...@gmail.com on 1 Apr 2011 at 5:32

GoogleCodeExporter commented 8 years ago
Do you think it's worth providing *.bat and *.sh files to run benchmark? I am 
not sure all protostuff users will guess the correct way and inability to build 
benchmark is a bit frustrating... For instance, I'm new to Maven and 100% I'm 
unable to figure out this way you showed :)

Original comment by Vladisla...@gmail.com on 3 Apr 2011 at 8:11

GoogleCodeExporter commented 8 years ago
Woops, it was missing some args.
It should be:
mvn -DforkMode=never -Dbenchmark.skip=false -Dtest=BenchmarkTest test

I updated the README.txt in the protostuff-benchmark dir with those 
instructions.

I try to avoid using .bat/.sh files when it can be done with maven or plain 
java -jar

Original comment by david.yu...@gmail.com on 3 Apr 2011 at 9:00