Java Doc for PerfTest.java in  » Internationalization-Localization » icu4j » com » ibm » icu » dev » test » perf » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Internationalization Localization » icu4j » com.ibm.icu.dev.test.perf 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ibm.icu.dev.test.perf.PerfTest

All known Subclasses:   com.ibm.icu.dev.test.perf.UCharacterPerf,  com.ibm.icu.dev.test.perf.RBBIPerf,  com.ibm.icu.dev.test.perf.ResourceBundlePerf,  com.ibm.icu.dev.test.perf.NormalizerPerformanceTest,  com.ibm.icu.dev.test.perf.UnicodeSetPerf,
PerfTest
abstract public class PerfTest (Code)
Base class for performance testing framework. To use, the subclass can simply define one or more instance methods with names beginning with "test" (case ignored). The prototype of the method is PerfTest.Function testTheName() The actual performance test will execute on the returned Commond object (refer to Command Pattern). To call a test from command line, the 'test' prefix of the test method name can be ignored/removed. In addition, the subclass should define a main() method that calls PerfTest.run() as defined here. If the subclasses uses any command line arguments (beyond those handled automatically by this calss) then it should override PerfTest.setup() to handle its arguments. If the subclasse needs more sophisticated management for controlling finding/calling test method, it can replace the default implementation for PerfTest.testProvider before calling PerfTest.run(). Example invocation: java -cp classes -verbose:gc com.ibm.icu.dev.test.perf.UnicodeSetPerf --gc --passes 4 --iterations 100 UnicodeSetAdd [[:l:][:c:]] Example output: [GC 511K->192K(1984K), 0.0086170 secs] [GC 704K->353K(1984K), 0.0059619 secs] [Full GC 618K->371K(1984K), 0.0242779 secs] [Full GC 371K->371K(1984K), 0.0228649 secs] = testUnicodeSetAdd begin 100 = testUnicodeSetAdd end 11977 1109044 = testUnicodeSetAdd begin 100 = testUnicodeSetAdd end 12047 1109044 = testUnicodeSetAdd begin 100 = testUnicodeSetAdd end 11987 1109044 = testUnicodeSetAdd begin 100 = testUnicodeSetAdd end 11978 1109044 The [] lines are emitted by the JVM as a result of the -verbose:gc switch. Lines beginning with '=' are emitted by PerfTest: = testUnicodeSetAdd begin 100 A 'begin' statement contains the name of the setup method, which determines what test function is measures, and the number of iterations that will be times. = testUnicodeSetAdd end 12047 1109044 An 'end' statement gives the name of the setup method again, and then two integers. The first is the total elapsed time in milliseconds, and the second is the number of events per iteration. In this example, the time per event is 12047 / (100 * 1109044) or 108.6 ns/event. Raw times are given as integer ms, because this is what the system measures.
author:
   Alan Liu
since:
   ICU 2.4

Inner Class :static interface TestCmdProvider
Inner Class :static class TestPrefixProvider implements TestCmdProvider
Inner Class :abstract public static class Function
Inner Class :public static class UsageException extends Exception

Field Summary
final static  intBULK_MODE
    
final static  intENCODING
    
final static  intFILE_NAME
    
final static  intGARBAGE_COLLECT
    
final static  intHELP1
     These must be kept in sync with getOptions().
final static  intHELP2
    
final static  intITERATIONS
    
final static  intLINE_MODE
    
final static  intLIST
    
final static  intLOCALE
    
final static  intPASSES
    
final static  intSOURCEDIR
    
final static  intTIME
    
final static  intUSELEN
    
final static  intVERBOSE
    
protected  booleanbulk_mode
    
protected  booleandoPriorGC
    
protected  Stringencoding
    
protected  StringfileName
    
protected  intiterations
    
protected  booleanline_mode
    
protected  Localelocale
    
protected  intpasses
    
protected  StringsourceDir
    
protected  TestCmdProvidertestProvider
    
protected  inttime
    
protected  booleanuselen
    
protected  booleanverbose
    

Constructor Summary
protected  PerfTest()
     Constructor.

Method Summary
protected  voidgc()
     Invoke the runtime's garbage collection procedure repeatedly until the amount of free memory stabilizes to within 10%.
 UOption[]getOptions()
    
public  StringreadDataLine(BufferedReader br)
    
public  String[]readLines(String fileName, String encoding, boolean bulkMode)
    
public static  char[]readToEOS(InputStreamReader stream)
    
public static  byte[]readToEOS(InputStream stream)
    
final protected  voidrun(String[] args)
     Subclasses should call this method in their main().
protected  voidsetup(String[] args)
     Framework method.

Field Detail
BULK_MODE
final static int BULK_MODE(Code)



ENCODING
final static int ENCODING(Code)



FILE_NAME
final static int FILE_NAME(Code)



GARBAGE_COLLECT
final static int GARBAGE_COLLECT(Code)



HELP1
final static int HELP1(Code)
These must be kept in sync with getOptions().



HELP2
final static int HELP2(Code)



ITERATIONS
final static int ITERATIONS(Code)



LINE_MODE
final static int LINE_MODE(Code)



LIST
final static int LIST(Code)



LOCALE
final static int LOCALE(Code)



PASSES
final static int PASSES(Code)



SOURCEDIR
final static int SOURCEDIR(Code)



TIME
final static int TIME(Code)



USELEN
final static int USELEN(Code)



VERBOSE
final static int VERBOSE(Code)



bulk_mode
protected boolean bulk_mode(Code)



doPriorGC
protected boolean doPriorGC(Code)



encoding
protected String encoding(Code)



fileName
protected String fileName(Code)



iterations
protected int iterations(Code)



line_mode
protected boolean line_mode(Code)



locale
protected Locale locale(Code)



passes
protected int passes(Code)



sourceDir
protected String sourceDir(Code)



testProvider
protected TestCmdProvider testProvider(Code)



time
protected int time(Code)



uselen
protected boolean uselen(Code)



verbose
protected boolean verbose(Code)




Constructor Detail
PerfTest
protected PerfTest()(Code)
Constructor.




Method Detail
gc
protected void gc()(Code)
Invoke the runtime's garbage collection procedure repeatedly until the amount of free memory stabilizes to within 10%.



getOptions
UOption[] getOptions()(Code)



readDataLine
public String readDataLine(BufferedReader br) throws Exception(Code)



readLines
public String[] readLines(String fileName, String encoding, boolean bulkMode)(Code)



readToEOS
public static char[] readToEOS(InputStreamReader stream)(Code)



readToEOS
public static byte[] readToEOS(InputStream stream)(Code)



run
final protected void run(String[] args) throws Exception(Code)
Subclasses should call this method in their main(). run() will in turn call setup() with any arguments it does not parse. This method parses the command line and runs the tests given on the command line, with the given parameters. See the class description for details.



setup
protected void setup(String[] args)(Code)
Framework method. Default implementation does not parse any extra arguments. Subclasses may override this to parse extra arguments. Subclass implementations should NOT call the base class implementation.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.