Commit b4a599e
chore(profiling): revert dictionary optimization and add profiling support
Reverted Phase 1 optimization attempts that showed no improvement:
- Removed tryGetExisting() optimization from JfrToOtlpConverter
- Deleted tryGetExisting() method from FunctionTable
- The optimization added overhead (2 FunctionKey allocations vs 1)
Added JMH profiling support:
- Added profiling configuration to build.gradle.kts
- Enable with -PjmhProfile=true flag
- Configures stack profiler (CPU sampling) and GC profiler (allocations)
Profiling results reveal actual bottlenecks:
- JFR File I/O: ~20% (jafar-parser, external dependency)
- Protobuf encoding: ~5% (fundamental serialization cost)
- Conversion logic: ~3% (our code)
- Dictionary operations: ~1-2% (NOT the bottleneck)
Key findings:
- Dictionary operations already well-optimized at ~1-2% of runtime
- Modern JVM escape analysis optimizes temporary allocations
- Stack depth is dominant factor (O(n) frame processing)
- HashMap lookups (~10-20ns) dominated by I/O overhead
Updated documentation:
- BENCHMARKS.md: Added profiling section with findings
- ARCHITECTURE.md: Added profiling support and results
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent cfd59c3 commit b4a599e
File tree
4 files changed
+131
-13
lines changed- dd-java-agent/agent-profiling/profiling-otel
- doc
- src/main/java/com/datadog/profiling/otel
4 files changed
+131
-13
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
19 | 30 | | |
20 | 31 | | |
| |||
Lines changed: 20 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
331 | 331 | | |
332 | 332 | | |
333 | 333 | | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
334 | 339 | | |
335 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
336 | 347 | | |
337 | 348 | | |
338 | 349 | | |
| |||
344 | 355 | | |
345 | 356 | | |
346 | 357 | | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
347 | 367 | | |
348 | 368 | | |
349 | 369 | | |
| |||
Lines changed: 93 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 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 | + | |
151 | 173 | | |
152 | 174 | | |
153 | 175 | | |
| |||
156 | 178 | | |
157 | 179 | | |
158 | 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 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
159 | 245 | | |
160 | 246 | | |
161 | 247 | | |
162 | 248 | | |
163 | 249 | | |
164 | 250 | | |
| 251 | + | |
165 | 252 | | |
166 | 253 | | |
167 | 254 | | |
| |||
Lines changed: 7 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
386 | 390 | | |
387 | 391 | | |
388 | 392 | | |
389 | 393 | | |
390 | 394 | | |
391 | 395 | | |
392 | 396 | | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
400 | 399 | | |
| 400 | + | |
401 | 401 | | |
402 | | - | |
| 402 | + | |
403 | 403 | | |
404 | 404 | | |
405 | 405 | | |
| |||
0 commit comments