Fix call-site-plugin build script to avoid rebuilding plugin every time#6921
Fix call-site-plugin build script to avoid rebuilding plugin every time#6921PerfectSlayer merged 4 commits intomasterfrom
Conversation
BenchmarksStartupLoadParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 16 unstable metrics. Request duration reports for petclinicgantt
title petclinic - request duration [CI 0.99] : candidate=1.33.0-SNAPSHOT~54a1da4b19, baseline=1.33.0-SNAPSHOT~34e706697c
dateFormat X
axisFormat %s
section baseline
no_agent (1.355 ms) : 1335, 1374
. : milestone, 1355,
appsec (1.723 ms) : 1698, 1748
. : milestone, 1723,
appsec_no_iast (1.719 ms) : 1695, 1744
. : milestone, 1719,
iast (1.501 ms) : 1478, 1524
. : milestone, 1501,
profiling (1.495 ms) : 1471, 1520
. : milestone, 1495,
tracing (1.475 ms) : 1452, 1499
. : milestone, 1475,
section candidate
no_agent (1.353 ms) : 1334, 1373
. : milestone, 1353,
appsec (1.736 ms) : 1712, 1760
. : milestone, 1736,
appsec_no_iast (1.705 ms) : 1681, 1730
. : milestone, 1705,
iast (1.49 ms) : 1466, 1513
. : milestone, 1490,
profiling (1.491 ms) : 1466, 1516
. : milestone, 1491,
tracing (1.479 ms) : 1455, 1504
. : milestone, 1479,
Request duration reports for insecure-bankgantt
title insecure-bank - request duration [CI 0.99] : candidate=1.33.0-SNAPSHOT~54a1da4b19, baseline=1.33.0-SNAPSHOT~34e706697c
dateFormat X
axisFormat %s
section baseline
no_agent (370.71 µs) : 349, 393
. : milestone, 371,
iast (472.058 µs) : 451, 493
. : milestone, 472,
iast_FULL (544.425 µs) : 523, 566
. : milestone, 544,
iast_GLOBAL (501.782 µs) : 480, 523
. : milestone, 502,
iast_HARDCODED_SECRET_DISABLED (477.115 µs) : 456, 498
. : milestone, 477,
iast_INACTIVE (451.399 µs) : 430, 473
. : milestone, 451,
iast_TELEMETRY_OFF (475.27 µs) : 454, 496
. : milestone, 475,
tracing (446.887 µs) : 426, 468
. : milestone, 447,
section candidate
no_agent (373.262 µs) : 354, 393
. : milestone, 373,
iast (479.477 µs) : 459, 500
. : milestone, 479,
iast_FULL (540.047 µs) : 519, 561
. : milestone, 540,
iast_GLOBAL (519.141 µs) : 496, 543
. : milestone, 519,
iast_HARDCODED_SECRET_DISABLED (473.191 µs) : 453, 494
. : milestone, 473,
iast_INACTIVE (452.753 µs) : 432, 474
. : milestone, 453,
iast_TELEMETRY_OFF (476.023 µs) : 455, 497
. : milestone, 476,
tracing (444.047 µs) : 424, 465
. : milestone, 444,
DacapoParameters
See matching parameters
SummaryFound 0 performance improvements and 0 performance regressions! Performance is the same for 12 metrics, 0 unstable metrics. Execution time for tomcatgantt
title tomcat - execution time [CI 0.99] : candidate=1.33.0-SNAPSHOT~54a1da4b19, baseline=1.33.0-SNAPSHOT~34e706697c
dateFormat X
axisFormat %s
section baseline
no_agent (1.457 ms) : 1445, 1468
. : milestone, 1457,
appsec (2.186 ms) : 2153, 2220
. : milestone, 2186,
iast (1.875 ms) : 1840, 1910
. : milestone, 1875,
iast_GLOBAL (1.912 ms) : 1876, 1947
. : milestone, 1912,
profiling (1.829 ms) : 1796, 1862
. : milestone, 1829,
tracing (1.816 ms) : 1785, 1848
. : milestone, 1816,
section candidate
no_agent (1.454 ms) : 1443, 1465
. : milestone, 1454,
appsec (2.182 ms) : 2149, 2214
. : milestone, 2182,
iast (1.861 ms) : 1826, 1895
. : milestone, 1861,
iast_GLOBAL (1.909 ms) : 1875, 1944
. : milestone, 1909,
profiling (1.851 ms) : 1816, 1885
. : milestone, 1851,
tracing (1.823 ms) : 1791, 1856
. : milestone, 1823,
Execution time for biojavagantt
title biojava - execution time [CI 0.99] : candidate=1.33.0-SNAPSHOT~54a1da4b19, baseline=1.33.0-SNAPSHOT~34e706697c
dateFormat X
axisFormat %s
section baseline
no_agent (15.091 s) : 15091000, 15091000
. : milestone, 15091000,
appsec (14.945 s) : 14945000, 14945000
. : milestone, 14945000,
iast (18.677 s) : 18677000, 18677000
. : milestone, 18677000,
iast_GLOBAL (18.093 s) : 18093000, 18093000
. : milestone, 18093000,
profiling (15.19 s) : 15190000, 15190000
. : milestone, 15190000,
tracing (15.268 s) : 15268000, 15268000
. : milestone, 15268000,
section candidate
no_agent (15.4 s) : 15400000, 15400000
. : milestone, 15400000,
appsec (14.874 s) : 14874000, 14874000
. : milestone, 14874000,
iast (18.817 s) : 18817000, 18817000
. : milestone, 18817000,
iast_GLOBAL (17.701 s) : 17701000, 17701000
. : milestone, 17701000,
profiling (15.55 s) : 15550000, 15550000
. : milestone, 15550000,
tracing (14.784 s) : 14784000, 14784000
. : milestone, 14784000,
|
Build folder was cleared at each task creation, breaking task caching (output was removed) It does no more clear the build/generated/sources/csi. It will be cleared as part of the `clean` gradle task. Generated files will still be updated if the sources files (build/classes/raw) are updated.
newTempFile clears existing files as withWriter does. Avoid doing twice for build performance.
29e125b to
54a1da4
Compare
|
One of the reasons why the plugin was dropping the generated source files is that under very particular circumstances (e.g. after certain incompatible changes in the call site definition), the generated sources ended up in a bad state that forced us to delete them by hand. It's very possible that this is no longer an issue (e.g. gradle has been updated a few times) and since we don't update call sites so often nowadays I think that shouldn't be a problem any more. Many thanks for the change @PerfectSlayer |
I checked the following things:
The only issue I found is if you delete a source file related to CSI, you might have build issue. |
What Does This Do
This PR fixes the CSI (Call Site Plugin) build script which is part of the project build script.
There are two main fixes:
Avoid rebuilding CSI plugin jar for every Gradle command
CSI plugin shadowed jar was built for every gradle command runned as part of the project configuration:

With the changes, all plugin gradle tasks are properly cached (

UP-TO-DATEstate):Avoid generating call site sources file for every build
CSI plugin drops generated call site source files (from
build/generated/sources/csi/) for every build, breaking the task cache and making the plugin needed to re-run.Running

gradlew :dd-java-agent:shadowJarmultiple times shows CSI plugin tasks are not cached and are the slowest taks to run:After the fix, all

generateCallSiteJavagenerated tasks are properly cached:The generated source files will still be cleared as part of the
cleangradle task and will still be updated if the sources files (build/classes/raw) are updated.Other changes
Motivation
This should help to run gradle project configuration step faster.
Additional Notes
Fixes and upgrades are split in multiple commits to help reviewing the PR.
Jira ticket: [PROJ-IDENT]