26. How to detect?
• Input: Test code + system under test
• Steps:
1. Instrument the system under test
Monitor loop starts/ends & memory reads inside loops
2. Analyze trace produced by instrumentaEon
IdenEfy repeEEve memory-read sequences
• Output: Loops that are likely performance bugs
26
27. Evalua%on Subjects and New Bugs
27
Applica%on Descrip%on LOC Known Bugs New Bugs Fixed Confirmed
Ant Build tool 109,765 1 8 1 0
Apache CollecEons CollecEons library 51,516 1 20 10 4
Groovy Dynamic language 136,994 1 2 2 0
Google Core Libraries CollecEons library 156,004 2 10 1 2
JFreeChart Chart framework 64,184 1 1 0 0
Jmeter Load tesEng tool 86,549 1 0 0 0
Lucene Text search engine 320,899 2 0 0 0
PDFBox PDF framework 78,578 1 0 0 0
Solr Search server 373,138 1 0 0 0
JDK standard library 2 0 0
JUnit tesEng framework 1 1 0
9 Apps + 2 Libs 50,000 – 320,000 11 44 15 6
28. Toddler vs. HProf
28
Known Bug
Bug Detected? False P. Rank Slowdown
TODD. PROF TODD. PROF TODD. PROF
Ant ü û 0 19.3 13.7 4.2
Apache CollecEons ü ü 0 1.0 10.0 2.1
Groovy ü ü 0 3.7 15.5 3.7
Google Core Libraries #1 ü ü 0 1.8 9.0 3.8
Google Core Libraries #2 ü û 0 5.3 7.5 3.2
JFreeChart ü û 0 53.7 13.4 8.8
JMeter ü û 0 10.3 8.5 1.9
Lucene #1 ü û 0 7.7 6.8 2.5
Lucene #2 ü ü 0 3.1 25.4 3.1
PDFBox ü û 1 18.8 51.8 12.1
Solr ü û 0 178.3 114.2 7.1
11 11 4 1 n/a 15.9X 4.0X