Stabilize ModuleDependency descriptions#1648
Conversation
f934965 to
13ac918
Compare
|
Thank you so much for your contribution, and first of all sorry for the late feedback! The only thing I'd like to test is how much sorting affects the performance, but other than that, I have no concerns that we can integrate your fix soon. |
4c68455 to
c47468c
Compare
Sort class dependency descriptions before rendering a module dependency so the text remains stable across set iteration orders. Issue: TNG#1630 Signed-off-by: DragonFSKY <38503900+DragonFSKY@users.noreply.github.com>
Signed-off-by: DragonFSKY <38503900+DragonFSKY@users.noreply.github.com>
c47468c to
77dfee9
Compare
|
Thanks for taking a look, and no worries about the timing! I fixed the DCO issue and normalized both commits to the same GitHub identity/sign-off. I also ran a targeted local benchmark on JDK 25 using real ModuleDependency instances built from ArchUnit classes. It compared the previous unsorted description rendering with the sorted rendering in this PR; the figures below are medians from seven alternating rounds:
So the relative cost is visible for large dependency sets, but the absolute overhead stayed around 2 ms even for the largest real module dependency in this sample, and it is limited to the getDescription/reporting path. I hope this helps with the performance assessment. |
Fixes #1630.
This makes
ModuleDependency#getDescription()render its underlying class dependencies in their naturalDependencyorder, instead of relying on the iteration order of the backing set. The collected dependencies are unchanged; only the textual report output is stabilized.A regression test verifies that the rendered description follows the same sorted dependency order.
Tested with: