Library Usage Analyzer

Since I am writing a simple JVM. Most part of JVM work is implement libraries. But it is impossible for me to implement all classes specified in JDK. So I need analyze which classes in JDK are most popular, and which methods and fields are most popular.

 

So I implemented an Library Usage tool to analyze it.

 

the jar file only depend jdk.

 

How to run it.

java -jar Analyzer.jar

 

All option supported will be print out.

Analyze class usage. It can be used in to scenarios
scenario 1:
    which part in a library are most common be used.
    e.g. which part of jdk are most common be used.
        the most common used part can be think about be optimized.
scenario 2:
    what are most common be used by the library.

Command Format
    Analyzer -fjarfilename [-sprefix] [-aprefix] [-eprefix]
Options
    -f : jar files want to be analyzed
         it must be provided one or more jar files
    -s : prefix of class name want to be output to statistic
         it can be accept more than one option
         default class prefix is 'java.' if do not provide any option
    -n : prefix of class name do not want to be output to statistic
         it can be accept more than one option
    -a : prefix of class name want to be analyzed
         it can be accept more than one option
         all classes in jar files will be analyzed if do not provide any option
    -e : prefix of class name do not want to be analyzed
         it can be accept more than one option
Examples :
    Analyzer -fbcel.jar
        all classes in bcel.jar will be analyzed.
        statistics for classes with 'java.' prefix will be outputted
    Analyzer -fbcel.jar -fdom4j.jar
        all classes in bcel.jar and dom4j.jar will be analyzed.
        statistics for classes with 'java.' prefix will be outputted
    Analyzer -fbcel.jar -fdom4j.jar -pjava.lang -pjava.util
        all classes in bcel.jar and dom4j will be analyzed.
        statistics for classes with 'java.' and 'java.util' prefix will be outputted
    Analyzer -fbcel.jar -aorg.apache
        all classes with 'org.apache' prefix in bcel.jar will be analyzed.
        statistics for classes with 'java' prefix will be outputted
    Analyzer -fbcel.jar -eorg.apache
        all classes are not with 'org.apache' prefix in bcel.jar will be analyzed.
        statistics for classes with 'java' prefix will be outputted
    Analyzer -fbcel.jar -njava
        all classes except classes with 'org.apache' prefix in bcel.jar will be analyzed.
        statistics for classes are not with 'java' prefix will be outputted
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值