@@ -357,10 +357,15 @@ To give an idea, we ran the benchmark with the following settings:
357357
358358- ** CPU:** Intel i7 2.70GHz (x86-64, confined ` java ` process to a single core
359359 using [ ` taskset -c 0 ` ] ( http://www.man7.org/linux/man-pages/man1/taskset.1.html ) )
360- - ** JVM:** Java HotSpot 1.8.0_192 (` -XX:+TieredCompilation ` , ` -XX:+AggressiveOpts ` )
361- - ** OS:** Xubuntu 18.04.3 (4.15.0-54-generic, x86-64)
362- - ** ` LogstashLayout4{Ecs,Json}Layout ` ** used default settings with the following exceptions:
363- - ** ` emptyPropertyExclusionEnabled ` :** ` false `
360+ - ** JVM:** OpenJDK 64-Bit, AdoptOpenJDK, build 25.232-b09
361+ - ` -XX:+TieredCompilation `
362+ - ` -Dlog4j2.garbagefreeThreadContextMap=true `
363+ - ` -Dlog4j2.enableDirectEncoders=true `
364+ - ` -Dlog4j2.enable.threadlocals=true `
365+ - ` -Dlog4j2.is.webapp=false `
366+ - ** OS:** Xubuntu 18.04.3 (4.15.0-70-generic, x86-64)
367+ - ** ` LogstashLayout4{Ecs,Json,Gelf}Layout ` ** used default settings with the
368+ following exceptions:
364369 - ** ` stackTraceEnabled ` :** ` true `
365370 - ** ` maxByteCount ` :** (4096) 4KiB
366371- ** ` JsonLayout ` ** used in two different flavors:
@@ -371,6 +376,8 @@ To give an idea, we ran the benchmark with the following settings:
371376- ** ` EcsLayout ` ** used with the following configurations:
372377 - ** ` serviceName ` :** ` benchmark `
373378 - ** ` additionalFields ` :** ` new KeyValuePair[0] `
379+ - ** ` GelfLayout ` ** used with the following configurations:
380+ - ** ` compressionType ` :** ` off `
374381
375382The figures for serializing 1,000 ` LogEvent ` s at each operation are as follows.
376383(See [ ` layout-benchmark ` ] ( layout-benchmark ) directory for the full report.)
@@ -385,65 +392,89 @@ The figures for serializing 1,000 `LogEvent`s at each operation are as follows.
385392 </tr>
386393 </thead>
387394 <tbody>
395+ <tr data-benchmark="liteLogstashLayout4GelfLayout">
396+ <td class="benchmark">liteLogstashLayout4GelfLayout</td>
397+ <td class="op_rate">1,517,062</td>
398+ <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (100%)</td>
399+ <td class="gc_rate">0.0</td>
400+ </tr>
388401 <tr data-benchmark="liteLogstashLayout4EcsLayout">
389402 <td class="benchmark">liteLogstashLayout4EcsLayout</td>
390- <td class="op_rate">813,346 </td>
391- <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (100 %)</td>
392- <td class="gc_rate">4,545 .0</td>
403+ <td class="op_rate">1,196,255 </td>
404+ <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (79 %)</td>
405+ <td class="gc_rate">0 .0</td>
393406 </tr>
394- <tr data-benchmark="liteEcsLayout ">
395- <td class="benchmark">liteEcsLayout </td>
396- <td class="op_rate">603,469 </td>
397- <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (74 %)</td>
398- <td class="gc_rate">460.9 </td>
407+ <tr data-benchmark="liteGelfLayout ">
408+ <td class="benchmark">liteGelfLayout </td>
409+ <td class="op_rate">1,184,922 </td>
410+ <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (78 %)</td>
411+ <td class="gc_rate">0.0 </td>
399412 </tr>
400413 <tr data-benchmark="liteLogstashLayout4JsonLayout">
401414 <td class="benchmark">liteLogstashLayout4JsonLayout</td>
402- <td class="op_rate">564,456</td>
403- <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉▉▉▉ (69%)</td>
404- <td class="gc_rate">492.7</td>
415+ <td class="op_rate">870,012</td>
416+ <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉ (57%)</td>
417+ <td class="gc_rate">0.0</td>
418+ </tr>
419+ <tr data-benchmark="liteEcsLayout">
420+ <td class="benchmark">liteEcsLayout</td>
421+ <td class="op_rate">836,648</td>
422+ <td class="op_rate_bar">▉▉▉▉▉▉▉▉▉▉▉ (55%)</td>
423+ <td class="gc_rate">0.0</td>
405424 </tr>
406425 <tr data-benchmark="liteDefaultJsonLayout">
407426 <td class="benchmark">liteDefaultJsonLayout</td>
408- <td class="op_rate">294,590 </td>
409- <td class="op_rate_bar">▉▉▉▉▉▉▉ (36 %)</td>
410- <td class="gc_rate">5,101,398.2 </td>
427+ <td class="op_rate">506,985 </td>
428+ <td class="op_rate_bar">▉▉▉▉▉▉▉ (33 %)</td>
429+ <td class="gc_rate">5,331,680.0 </td>
411430 </tr>
412431 <tr data-benchmark="liteCustomJsonLayout">
413432 <td class="benchmark">liteCustomJsonLayout</td>
414- <td class="op_rate">258,302 </td>
415- <td class="op_rate_bar">▉▉▉▉▉▉▉ (32 %)</td>
416- <td class="gc_rate">5,516,833.5 </td>
433+ <td class="op_rate">446,243 </td>
434+ <td class="op_rate_bar">▉▉▉▉▉▉ (29 %)</td>
435+ <td class="gc_rate">5,740,400.0 </td>
417436 </tr>
418437 <tr data-benchmark="fullLogstashLayout4JsonLayout">
419438 <td class="benchmark">fullLogstashLayout4JsonLayout</td>
420- <td class="op_rate">70,755</td>
421- <td class="op_rate_bar">▉▉ (9%)</td>
422- <td class="gc_rate">108,258.8</td>
439+ <td class="op_rate">118,294</td>
440+ <td class="op_rate_bar">▉▉ (8%)</td>
441+ <td class="gc_rate">104,000.1</td>
442+ </tr>
443+ <tr data-benchmark="fullLogstashLayout4GelfLayout">
444+ <td class="benchmark">fullLogstashLayout4GelfLayout</td>
445+ <td class="op_rate">73,102</td>
446+ <td class="op_rate_bar">▉ (5%)</td>
447+ <td class="gc_rate">35,663,200.3</td>
423448 </tr>
424449 <tr data-benchmark="fullLogstashLayout4EcsLayout">
425450 <td class="benchmark">fullLogstashLayout4EcsLayout</td>
426- <td class="op_rate">41,913 </td>
427- <td class="op_rate_bar">▉ (5 %)</td>
428- <td class="gc_rate">35,690,881.3 </td>
451+ <td class="op_rate">60,569 </td>
452+ <td class="op_rate_bar">▉ (4 %)</td>
453+ <td class="gc_rate">35,631,200.4 </td>
429454 </tr>
430455 <tr data-benchmark="fullEcsLayout">
431456 <td class="benchmark">fullEcsLayout</td>
432- <td class="op_rate">16,594</td>
433- <td class="op_rate_bar">▉ (2%)</td>
434- <td class="gc_rate">46,495,593.1</td>
457+ <td class="op_rate">27,887</td>
458+ <td class="op_rate_bar">▉ (2%)</td>
459+ <td class="gc_rate">46,479,200.5</td>
460+ </tr>
461+ <tr data-benchmark="fullGelfLayout">
462+ <td class="benchmark">fullGelfLayout</td>
463+ <td class="op_rate">21,458</td>
464+ <td class="op_rate_bar">▉ (1%)</td>
465+ <td class="gc_rate">58,911,200.7</td>
435466 </tr>
436467 <tr data-benchmark="fullDefaultJsonLayout">
437468 <td class="benchmark">fullDefaultJsonLayout</td>
438- <td class="op_rate">8,484 </td>
439- <td class="op_rate_bar">▉ (1%)</td>
440- <td class="gc_rate">234,422,375.7 </td>
469+ <td class="op_rate">13,513 </td>
470+ <td class="op_rate_bar">▉ (1%)</td>
471+ <td class="gc_rate">234,102,401.5 </td>
441472 </tr>
442473 <tr data-benchmark="fullCustomJsonLayout">
443474 <td class="benchmark">fullCustomJsonLayout</td>
444- <td class="op_rate">8,456 </td>
445- <td class="op_rate_bar">▉ (1%)</td>
446- <td class="gc_rate">234,624,867.7 </td>
475+ <td class="op_rate">13,511 </td>
476+ <td class="op_rate_bar">▉ (1%)</td>
477+ <td class="gc_rate">234,238,401.5 </td>
447478 </tr>
448479 </tbody>
449480 </table>
@@ -460,7 +491,7 @@ Let us try to answer some common questions:
460491 ` ObjectMapper ` , which needs to walk over the class fields via reflection and
461492 perform heavy branching and intermediate object instantiation. On the
462493 contrary, ` log4j2-logstash-layout ` parses the given template once and
463- compiles an (almost ) garbage- and (to a certain extent) branching-free
494+ compiles a (mostly ) garbage- and (to a certain extent) branching-free
464495 JSON generator employing Jackson ` JsonGenerator ` .
465496
466497- ** Why is ` log4j2-logstash-layout ` is not totally garbage-free?**
@@ -474,7 +505,7 @@ Let us try to answer some common questions:
474505 ` Long ` , or ` byte[] ` .
475506
476507- ** How can one run the benchmark on his/her machine?** After a fresh
477- ` mvn clean package ` within the source directory, run
508+ ` mvn clean verify ` within the source directory, run
478509 ` layout-benchmark/benchmark.py ` .
479510
480511- ** What about thread-local allocations?** Even though Log4j 2 exposes a
0 commit comments