-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJDK8Complexity.html
More file actions
209 lines (179 loc) · 10.4 KB
/
JDK8Complexity.html
File metadata and controls
209 lines (179 loc) · 10.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<!DOCTYPE HTML>
<html>
<head>
<title>Complexity of the JDK8</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script src="/js/jquery.min.js"></script>
<script src="/js/skel.min.js"></script>
<script src="/js/skel-layers.min.js"></script>
<script src="/js/init.js"></script>
<script src="/js/highlight.pack.js"></script>
<link rel="stylesheet" href="/css/highlight/github.css" />
<noscript>
<link rel="stylesheet" href="/css/skel.css" />
<link rel="stylesheet" href="/css/style.css" />
<link rel="stylesheet" href="/css/style-xlarge.css" />
</noscript>
</head>
<body id="top">
<header id="header" class="skel-layers-fixed">
<h2><a href="/"><img src="/OPALLogo.png" width="25" height="25"> OPAL Project</a></h2>
<nav id="nav">
<ul>
<li><a href="/Publications.html">Publications</a></li>
<li><a href="/library/api/SNAPSHOT/org/opalj/index.html">ScalaDoc</a></li>
<li><a href="https://github.com/opalj/OPAL">Repository</a></li>
<li><a href="https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.opal-project%22">Maven Central</a></li>
</ul>
</nav>
</header>
<section id="one" class="wrapper style1">
<div class="container">
<div class="row">
<div class="3u">
<nav>
<a href="/UsingOPAL.html">Using OPAL</a><br>
<br><b>Getting Started</b><br>
<a href="/tutorial/FixedPointAnalyses.html">Writing Fixed-Point Analyses</a><br>
<a href="/tutorial/CollaborativeAnalyses.html">Collaborative Analyses</a><br>
<a href="/tutorial/Lattices.html">Lattices</a><br>
<a href="/tutorial/Results.html">Results</a><br>
<a href="/tutorial/Schedulers.html">Schedulers</a><br>
<br><b>Further Tutorials</b><br>
<a href="/examples/ReadingClassFiles.html">Reading Class Files</a><br>
<a href="/examples/Projects.html">Loading Java Projects</a><br>
<a href="/examples/ClassHierarchy.html">Using the Class Hierarchy</a><br>
<a href="/examples/BytecodeEngineering.html">Engineering Java Bytecode</a><br>
<a href="/examples/TAC.html">3-Address Code/SSA Code</a><br>
<a href="/examples/WritingAnalyses.html">Writing Analyses</a><br>
<br><b>Tools</b><br>
<a href="/DeveloperTools.html">Developers Tools</a><br>
<a href="/Hermes.html">Hermes</a><br>
<a href="/Opium.html">OPIUM</a><br>
<br><b>Showcases</b><br>
<a href="/UselessBoxing.html">Detecting Useless Boxings</a><br>
<a href="/JDK8Dependencies.html">Package Dependencies in JDK8</a><br>
<a href="/JDK8Complexity.html">Complexity of the JDK8</a><br>
<br><b>Artifacts</b><br>
<a href="/Artifacts.html">Research Artifacts</a><br>
</nav>
<hr/>
<div class="hide-at-medium">
Please, report issues or problems in the documentation using <a href="https://github.com/opalj/OPAL/issues">OPAL's issue tracker</a>, by going to the <a href="https://gitter.im/OPAL-Project/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link">OPAL gitter chat room</a> or by writing an email to <a href="mailto:opal_at_st.informatik.tu-darmstadt.de">opal(at)st.informatik.tu-darmstadt.de</a>.
</div>
</div>
<div class="9u">
<section>
<link type="text/css" href="css/infovis-icicle.css" rel="stylesheet" />
<script language="javascript" type="text/javascript" src="js/infovis-jit-yc.js"></script>
<script language="javascript" type="text/javascript" src="JDK8Complexity.data.js"></script>
<script type="text/javascript">window.addEventListener('load',initViz,false);</script>
<h1>Visualizing Java 8</h1>
<p>
The following is a visualization of the relative size of the packages – measured in terms of the number of bytecode instructions – of Oracle JDK 1.8.0's runtime jar (rt.jar) for Mac OS X.
As you can see, the <code>java</code> package and its subpackages contains a major part of the code.
Another major package is (more or less as expected) the <code>javax</code> package. (JavaFX is stored in another jar and is not considered here.)
</p>
<p>
However, it is very interesting that more than half of the code belongs to packages (<code>com</code> and <code>sun</code>) that are not intended to be used by the regular Java developer.
</p>
<p>
To get more detailed information on a package and its sub-packages just <emph>left-click</emph> on the package. If you want to get more abstract information <emph>right click</emph> on the package.
</p>
<div id="infovis"></div>
<div>
<label for="s-orientation">Orientation: </label>
<select name="s-orientation" id="s-orientation">
<option value="h" selected>horizontal</option>
<option value="v">vertical</option>
</select>
<div id="max-levels">
<label for="i-levels-to-show">Max levels: </label>
<select id="i-levels-to-show" name="i-levels-to-show" style="width: 50px">
<option>all</option>
<option>1</option>
<option>2</option>
<option selected="selected">3</option>
<option>4</option>
<option>5</option>
</select>
</div>
</div>
<!--<a style="visibility: hidden;" id="update" href="#" class="theme button white">Go to Parent</a>-->
<p>
The visualization was created using: <a href="https://philogb.github.io/jit/">JavaScript InfoVis Toolkit</a>.
</p>
<p>
The analysis was written using the OPAL Bytecode toolkit and is shown next (5 lines of boilerplate and 12 lines for the analysis).
<pre><code>object InstructionStatistics extends AnalysisApplication {
val analysis = new Analysis[URL, BasicReport] {
def description: String = "Collects information about the number of instructions per package."
def analyze(project: Project[URL], parameters: Seq[String]) = {
import scala.collection.mutable.{ HashSet, HashMap }
// FQPN = FullyQualifiedPackageName
val instructionsPerFQPN = HashMap.empty[String, Int]
for {
classFile <- project.allClassFiles
packageName = classFile.thisType.packageName
MethodWithBody(body) <- classFile.methods
} {
instructionsPerFQPN.update(
packageName,
instructionsPerFQPN.getOrElse(packageName, 0) + body.programCounters.size)
}
val json : String = // generate the JSON
BasicReport(json)
}
}
}</code></pre>
</p>
</section>
</div>
</div>
</div>
</section>
<footer id="footer">
<div class="container">
<div class="row double">
<div class="6u">
<h3>Stay connected and get help!</h3>
<ul class="icons">
<li><a href="https://twitter.com/intent/follow?original_referer=http%3A%2F%2Fwww.opal-project.de%2F&ref_src=twsrc%5Etfw®ion=follow_link&screen_name=TheOpalProject&tw_p=followbutton" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
<li><a href="https://gitter.im/OPAL-Project/Lobby?utm_source=share-link&utm_medium=link&utm_campaign=share-link" class="icon fa-users"><span class="label">Gitter</span></a></li>
<li><a href="https://trello.com/theopalproject" class="icon fa-trello"><span class="label">Trello</span></a></li>
<li><a href="https://stackoverflow.com/questions/tagged/opal-framework" class="icon fa-stack-overflow"><span class="label">Stackoverflow</span></a></li>
<li><a href="https://hub.docker.com/r/opalj/sbt_scala_opal" class="icon fa-cloud"><span class="label">Docker</span></a></li>
</ul>
<h3>Related</h3>
<ul class="alt">
<li><a href="https://www.openhub.net/p/OPAL-Project">OPAL on OpenHub</a></li>
</ul>
</div>
<div class="6u">
<h3>Supported By</h3>
<ul class="alt">
<li><a href="https://www.yourkit.com/"><img src="/images/yklogo.png" width="139", height="33"></a><br>
YourKit supports open source projects with its full-featured Java Profiler.
YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>
an innovative and intelligent tool for profiling Java applications.
</li>
</ul>
</div>
</div>
<ul class="copyright">
<li>© The OPAL Project. All rights reserved.</li>
<li><a href="https://raw.githubusercontent.com/opalj/opal/master/LICENSE">License (BSD 2 Clause)</a></li>
<li><img src="/Athene.png" height="27" style="vertical-align:middle"></li>
<li>Design: <a href="https://templated.co">TEMPLATED</a></li>
</ul>
</div>
</footer>
</body>
<script>
hljs.configure({
tabReplace: ' ', // 4 spaces
languages: ["scala","java"]
})
hljs.highlightAll()
</script>
</html>