Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-17363] Ludicrously slow load time [with lazyloading]
[JENKINS-19437] Implement load on demand functionality in Cppcheck - Lazy loaded details are stored in CppcheckResult member variable and never released by Java garbace collector since a reference to them exists forever. All build.xml files are loaded during Jenkins startup and never released, CppcheckResult objects are part of them. This is kind of a memory leak. The update will cause slight lower performance but releasing of the memory is much more important for long run tasks/daemons/servers. - Method lazyLoadSourceContainer() updated to return the data instead of their caching in a member variable. - If cached CppcheckSourceContainer object can't be loaded, an empty one will be created. Different constructor used to remove unnecessary exception catches. Recently added related if removed from CppcheckSourceContainer. - Condition moved from index.jelly to summary.jelly to be able to reuse the data and remove one unnecessary loading (performance). - Construction "key = ++key" has no meaning, updated to "++key" to resolve a warning.
- Loading branch information
1 parent
e912256
commit 5db2c79
Showing
4 changed files
with
61 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 48 additions & 42 deletions
90
src/main/resources/org/jenkinsci/plugins/cppcheck/CppcheckResult/summary.jelly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,51 @@ | ||
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:g="/jelly/cppcheck"> | ||
<st:header name="Content-Type" value="text/html;charset=UTF-8"/> | ||
<table class="pane sortable" id="files"> | ||
<tr> | ||
<td class="pane-header">Filename</td> | ||
<td class="pane-header" style="width:2em">LineNumber</td> | ||
<td class="pane-header" style="width:2em">CppCheckId</td> | ||
<td class="pane-header" style="width:2em">Severity</td> | ||
<td class="pane-header" style="width:60%">Message</td> | ||
</tr> | ||
<tbody> | ||
|
||
<j:forEach var="elt" items="${it.cppcheckSourceContainer.internalMap.values()}"> | ||
<j:set var="cppcheckfile" value="${elt.cppcheckFile}"/> | ||
<tr> | ||
<td class="pane"> | ||
<j:if test="${elt.isSourceIgnored()}"> | ||
${cppcheckfile.fileName} | ||
</j:if> | ||
<j:if test="${not elt.isSourceIgnored()}"> | ||
<a href="source.${cppcheckfile.key}">${cppcheckfile.fileName}</a> | ||
</j:if> | ||
|
||
|
||
</td> | ||
<td class="pane"> | ||
<j:if | ||
test="${elt.isSourceIgnored()}"> | ||
${cppcheckfile.lineNumber} | ||
</j:if> | ||
<j:if test="${not elt.isSourceIgnored()}"> | ||
<a href="source.${cppcheckfile.key}#${cppcheckfile.lineNumber}">${cppcheckfile.lineNumber} | ||
</a> | ||
</j:if> | ||
</td> | ||
<g:format value="${cppcheckfile.cppCheckId}" severity="${cppcheckfile.severity}"/> | ||
<g:format value="${cppcheckfile.severity}" severity="${cppcheckfile.severity}"/> | ||
<g:format value="${cppcheckfile.message}" severity="${cppcheckfile.severity}"/> | ||
</tr> | ||
</j:forEach> | ||
|
||
|
||
</tbody> | ||
</table> | ||
|
||
<j:set var="cachedContainer" value="${it.cppcheckSourceContainer}"/> | ||
|
||
<j:if test="${cachedContainer != null}"> | ||
|
||
<h2>Details</h2> | ||
|
||
<table class="pane sortable" id="files"> | ||
<tr> | ||
<td class="pane-header">Filename</td> | ||
<td class="pane-header" style="width:2em">LineNumber</td> | ||
<td class="pane-header" style="width:2em">CppCheckId</td> | ||
<td class="pane-header" style="width:2em">Severity</td> | ||
<td class="pane-header" style="width:60%">Message</td> | ||
</tr> | ||
<tbody> | ||
|
||
<j:forEach var="elt" items="${cachedContainer.internalMap.values()}"> | ||
<j:set var="cppcheckfile" value="${elt.cppcheckFile}"/> | ||
<tr> | ||
<td class="pane"> | ||
<j:if test="${elt.isSourceIgnored()}"> | ||
${cppcheckfile.fileName} | ||
</j:if> | ||
<j:if test="${not elt.isSourceIgnored()}"> | ||
<a href="source.${cppcheckfile.key}">${cppcheckfile.fileName}</a> | ||
</j:if> | ||
</td> | ||
<td class="pane"> | ||
<j:if test="${elt.isSourceIgnored()}"> | ||
${cppcheckfile.lineNumber} | ||
</j:if> | ||
<j:if test="${not elt.isSourceIgnored()}"> | ||
<a href="source.${cppcheckfile.key}#${cppcheckfile.lineNumber}">${cppcheckfile.lineNumber} | ||
</a> | ||
</j:if> | ||
</td> | ||
<g:format value="${cppcheckfile.cppCheckId}" severity="${cppcheckfile.severity}"/> | ||
<g:format value="${cppcheckfile.severity}" severity="${cppcheckfile.severity}"/> | ||
<g:format value="${cppcheckfile.message}" severity="${cppcheckfile.severity}"/> | ||
</tr> | ||
</j:forEach> | ||
|
||
</tbody> | ||
</table> | ||
|
||
</j:if> | ||
|
||
</j:jelly> |