This repository was archived by the owner on Dec 20, 2022. It is now read-only.
Commit 5a81503
committed
Staticly initialize DirectByteBuffer constructor
Java reflection is quite expensive (https://docs.oracle.com/javase/tutorial/reflect/index.html):
"Because reflection involves types that are dynamically resolved, certain Java virtual machine optimizations can not be performed.
Consequently, reflective operations have slower performance than their non-reflective counterparts,
and should be avoided in sections of code which are called frequently in performance-sensitive applications."
In critical path we call getByteBuffer quite frequently: https://user-images.githubusercontent.com/1121987/47508402-bcce9680-d87c-11e8-99d2-7b55677e4d3e.png
So we could statically initialize ByteBuffer constructor reflection, and only instantiate it based on the arguments.
Change-Id: Ibca8ddbd67c4239a6e462a453669b7519c89afc81 parent c340eae commit 5a81503
File tree
3 files changed
+15
-49
lines changed- src/main/java/org/apache/spark/shuffle/rdma
3 files changed
+15
-49
lines changedLines changed: 13 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
44 | 55 | | |
45 | 56 | | |
46 | 57 | | |
| |||
126 | 137 | | |
127 | 138 | | |
128 | 139 | | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | 140 | | |
144 | | - | |
| 141 | + | |
145 | 142 | | |
146 | 143 | | |
147 | 144 | | |
148 | | - | |
149 | 145 | | |
150 | 146 | | |
Lines changed: 1 addition & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
203 | | - | |
204 | 203 | | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 204 | + | |
219 | 205 | | |
220 | 206 | | |
221 | 207 | | |
222 | 208 | | |
223 | 209 | | |
224 | 210 | | |
225 | | - | |
226 | | - | |
227 | 211 | | |
228 | 212 | | |
229 | 213 | | |
| |||
Lines changed: 1 addition & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | 21 | | |
23 | 22 | | |
24 | 23 | | |
| |||
75 | 74 | | |
76 | 75 | | |
77 | 76 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
90 | | - | |
91 | 77 | | |
92 | 78 | | |
93 | | - | |
| 79 | + | |
94 | 80 | | |
95 | 81 | | |
96 | 82 | | |
| |||
0 commit comments