Caliper and Android in 2014

96 views
Skip to first unread message

Jacob Baungard Hansen

unread,
Oct 17, 2014, 6:56:48 AM10/17/14
to cal...@googlegroups.com
Hi,

I am very much interested in using Caliper to do things on Android, however after spending a considerable amount of time trying to get this to work I think it makes sense to ask for a bit of help here. All the documentation seems to be fairly outdated, which is a shame.

1) The "Caliper On Android" wiki page says that the 1.0 branch doesn't work on android. What is the state of this, should I still use 0.5 or is 1.0 working now? I have attempted running it but:

Build both caliper and the examples successfully. Then I run:

./vogar --mode device_dalvik --classpath /home/jacob/Downloads/caliper/caliper/target/caliper-1.0-beta-SNAPSHOT-all.jar --benchmark /home/jacob/Downloads/caliper/examples/src/main/java/examples/ArraySortBenchmark.java

vogar.commands.CommandFailedException: Command failed: dx -JXms16M -JXmx1536M --dex --output=/tmp/vogar/925eedb4-4c    7c-47d0-a798-ce725ed1aeb9/examples.ArraySortBenchmark/examples.ArraySortBenchmark.dex.jar --core-library /tmp/vogar    /925eedb4-4c7c-47d0-a798-ce725ed1aeb9/examples.ArraySortBenchmark/examples.ArraySortBenchmark.jar /home/jacob/Downl    oads/caliper/caliper/target/caliper-1.0-beta-SNAPSHOT-all.jar /home/jacob/Downloads/vogar-read-only/build/vogar.jar
warning
: Ignoring InnerClasses attribute for an anonymous inner class        
(com.google.inject.internal.cglib.core.$AbstractClassGenerator$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a  
compiler that did not target the modern .class file format. The recommended  
solution is to recompile the class from source, using an up-to-date compiler  
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly    
indicate that it is *not* an inner class.

(this happens a lot)

UNEXPECTED TOP-LEVEL EXCEPTION:                                              
    java.lang.IllegalArgumentException: already added: Lcom/google/caliper/Benchmark;
    at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122)  
    at com.android.dx.dex.file.DexFile.add(DexFile.java:161)                    
    at com.android.dx.command.dexer.Main.processClass(Main.java:685)            
    at com.android.dx.command.dexer.Main.processFileBytes(Main.java:634)        
    at com.android.dx.command.dexer.Main.access$600(Main.java:78)              
    at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:572)      
    at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
    at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166)
    at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144)
    at com.android.dx.command.dexer.Main.processOne(Main.java:596)              
    at com.android.dx.command.dexer.Main.processAllFiles(Main.java:498)        
    at com.android.dx.command.dexer.Main.runMonoDex(Main.java:264)              
    at com.android.dx.command.dexer.Main.run(Main.java:230)                    
    at com.android.dx.command.dexer.Main.main(Main.java:199)                    
    at com.android.dx.command.Main.main(Main.java:103)                          
  1 error; aborting                                                            
    at vogar.commands.Command.gatherOutput(Command.java:141)                      
    at vogar.commands.Command.execute(Command.java:150)                          
    at vogar.commands.Command$Builder.execute(Command.java:316)                  
    at vogar.android.AndroidSdk.dex(AndroidSdk.java:221)                          
    at vogar.android.DexTask.execute(DexTask.java:50)                            
    at vogar.tasks.Task.run(Task.java:91)                                        
    at vogar.tasks.TaskQueue.runOneTask(TaskQueue.java:143)                      
    at vogar.tasks.TaskQueue.access$000(TaskQueue.java:33)                        
    at vogar.tasks.TaskQueue$1.run(TaskQueue.java:71)                            
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)



2) Given the above I tried to checkout the 0.5rc1 branch (the release branch). However I am having issues building the examples. Below is the errors.

What I did:

git checkout remotes/origin/release
cd caliper
mvn clean
mvn -Dmaven.test.skip=true install
cd ../examples
mvn clean && mvn compile


[INFO] Scanning for projects...
[INFO]                                                                        
[INFO] ------------------------------------------------------------------------
[INFO] Building Caliper Examples 0.5-rc1
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0-beta-1:enforce (enforce-maven) @ caliper-examples ---
[INFO]
[INFO] --- maven-resources-plugin:2.3:resources (default-resources) @ caliper-examples ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/jacob/Downloads/caliper/examples/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:2.3.2:compile (default-compile) @ caliper-examples ---
[INFO] Compiling 17 source files to /home/jacob/Downloads/caliper/examples/target/classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/ExpensiveObjectsBenchmark.java:[20,32] error: package com.google.caliper.runner does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[20,29] error: package com.google.caliper.api does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[21,29] error: package com.google.caliper.api does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[22,29] error: package com.google.caliper.api does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[23,32] error: package com.google.caliper.runner does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[24,30] error: cannot find symbol
[ERROR]  package com.google.caliper.util
/home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[28,35] error: cannot find symbol
[ERROR]  class Benchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[34,31] error: cannot find symbol
[ERROR]  class DemoBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[20,29] error: package com.google.caliper.api does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[21,31] error: package com.google.caliper.model does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[22,32] error: package com.google.caliper.runner does not exist
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[33,46] error: cannot find symbol
[ERROR]  class Benchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[35,3] error: cannot find symbol
[ERROR]  class DemoBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[61,3] error: cannot find symbol
[ERROR]  class CompressionSizeBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/ExpensiveObjectsBenchmark.java:[73,4] error: cannot find symbol
[ERROR]  class ExpensiveObjectsBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[47,16] error: cannot find symbol
[ERROR]  class DemoBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[45,2] error: method does not override or implement a method from a supertype
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[67,2] error: method does not override or implement a method from a supertype
[ERROR] /home/jacob/Downloads/caliper/examples/src/main/java/examples/DemoBenchmark.java:[72,4] error: cannot find symbol
[ERROR]  class DemoBenchmark
/home/jacob/Downloads/caliper/examples/src/main/java/examples/CompressionSizeBenchmark.java:[88,4] error: cannot find symbol
[INFO] 20 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------


Any help would be much appreciated!

Kevin Bourrillion

unread,
Oct 29, 2014, 1:02:19 PM10/29/14
to cal...@googlegroups.com
I'm sorry I didn't notice there were messages in the moderation queue until now.

Caliper would definitely need some work to make it work properly on Android. I very roughly imagine that it could take a few weeks of actual effort. I'm sorry that this was not clear enough and it looks like you sunk a lot of time into trying to run it. :-(

Someone on the Android team is considering embarking on that project but I don't know more yet.



--
--
guava-...@googlegroups.com
Project site: http://caliper.googlecode.com
This group: http://groups.google.com/group/caliper
 
This list is for general discussion.
To report an issue: http://code.google.com/p/caliper/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "caliper")

---
You received this message because you are subscribed to the Google Groups "caliper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caliper+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jacob Baungard Hansen

unread,
Oct 30, 2014, 9:18:29 AM10/30/14
to cal...@googlegroups.com
Hi Kevin,

Thanks for getting back to me. It may be a good idea to update the documentation accordingly.

Do you know of any alternatives for benchmarking on Android? Caliper seems to be the only real solution out there, and it is a shame it no longer works.

Jacob
/home/jacob/Downloads/caliper/examples/src/main/<span st
...
Reply all
Reply to author
Forward
0 new messages