-
Couldn't load subscription status.
- Fork 76
Improve memory footprint #374
Conversation
- Use alias for each type of coverage node. - Use custom converter for coverage values.
Otherwise, applying the flyweight pattern will not be possible.
Codecov Report
@@ Coverage Diff @@
## master #374 +/- ##
============================================
+ Coverage 72.19% 72.68% +0.49%
- Complexity 963 975 +12
============================================
Files 81 82 +1
Lines 3506 3632 +126
Branches 410 432 +22
============================================
+ Hits 2531 2640 +109
- Misses 839 848 +9
- Partials 136 144 +8
Continue to review full report at Codecov.
|
Reuse coverage instances with coverage and missed < 16.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks goot to me! Just one little thing...
| xStream.alias("method", MethodCoverageNode.class); | ||
| xStream.alias("leaf", CoverageLeaf.class); | ||
| xStream.alias("coverage", Coverage.class); | ||
| xStream.alias("fraction", Fraction.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fraction is not used for serialization anymore. This alias can be removed.
…serialization # Conflicts: # plugin/src/main/java/io/jenkins/plugins/coverage/model/Coverage.java # plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageBuildAction.java # plugin/src/main/java/io/jenkins/plugins/coverage/model/CoverageNode.java # plugin/src/test/java/io/jenkins/plugins/coverage/model/CoverageNodeTest.java # plugin/src/test/java/io/jenkins/plugins/coverage/model/CoverageTest.java # plugin/src/test/java/io/jenkins/plugins/coverage/model/FileCoverageNodeTest.java
# Conflicts: # plugin/src/main/java/io/jenkins/plugins/coverage/model/CoveragePercentage.java # plugin/src/test/java/io/jenkins/plugins/coverage/model/FileCoverageNodeTest.java
@uhafner Yes, the coverage/line-mapping is the place where a lot of storage can be saved - the other maps used in Your idea for the serialization looks like the perfect improvement for this in my opinion. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! I tested it locally and the required disk space decreased a lot.
Improve XStream serialization and memory footprint for coverage instances:
Coverageinstances using a builderCoverageinstancesThe analysis-model XML now is 3.7M rather than 5.7M before.
After compacting the new mappings of line to coverage the size is even smaller (2.7M):
In a final step, all 4 new maps and sets have been simplified and we now have 2.3M: