diff options
author | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-28 11:58:30 (GMT) |
---|---|---|
committer | Dimitri van Heesch <doxygen@gmail.com> | 2021-03-28 12:25:48 (GMT) |
commit | c48639744a6fa118b9851b307107994ba93ce4c8 (patch) | |
tree | 8917c567f8f00560fba4554ade2b7e79bbe3ff45 /src/dotgroupcollaboration.cpp | |
parent | cef71dc4fcfca9e3580214c39f20dc538ed6b2d9 (diff) | |
download | Doxygen-c48639744a6fa118b9851b307107994ba93ce4c8.zip Doxygen-c48639744a6fa118b9851b307107994ba93ce4c8.tar.gz Doxygen-c48639744a6fa118b9851b307107994ba93ce4c8.tar.bz2 |
Refactoring: Add TextStream buffer to improve output writing performance
- direct use of std::stringstream and std::ostream gave a 30%
drop in performance.
Diffstat (limited to 'src/dotgroupcollaboration.cpp')
-rw-r--r-- | src/dotgroupcollaboration.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/dotgroupcollaboration.cpp b/src/dotgroupcollaboration.cpp index 9ee0bba..5157778 100644 --- a/src/dotgroupcollaboration.cpp +++ b/src/dotgroupcollaboration.cpp @@ -13,8 +13,6 @@ * */ -#include <sstream> - #include "dotgroupcollaboration.h" #include "classlist.h" #include "doxygen.h" @@ -22,6 +20,7 @@ #include "pagedef.h" #include "util.h" #include "config.h" +#include "textstream.h" DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd) { @@ -209,7 +208,7 @@ QCString DotGroupCollaboration::getBaseName() const void DotGroupCollaboration::computeTheGraph() { - std::ostringstream md5stream(std::ios_base::ate); + TextStream md5stream; writeGraphHeader(md5stream,m_rootNode->label()); // clean write flags @@ -240,7 +239,7 @@ QCString DotGroupCollaboration::getMapLabel() const return escapeCharsInString(m_baseName, FALSE); } -QCString DotGroupCollaboration::writeGraph( std::ostream &t, +QCString DotGroupCollaboration::writeGraph( TextStream &t, GraphOutputFormat graphFormat, EmbeddedOutputFormat textFormat, const char *path, const char *fileName, const char *relPath, bool generateImageMap,int graphId) @@ -250,7 +249,7 @@ QCString DotGroupCollaboration::writeGraph( std::ostream &t, return DotGraph::writeGraph(t, graphFormat, textFormat, path, fileName, relPath, generateImageMap, graphId); } -void DotGroupCollaboration::Edge::write( std::ostream &t ) const +void DotGroupCollaboration::Edge::write( TextStream &t ) const { const char* linkTypeColor[] = { "darkorchid3" @@ -315,7 +314,7 @@ bool DotGroupCollaboration::isTrivial() const return m_usedNodes.size() <= 1; } -void DotGroupCollaboration::writeGraphHeader(std::ostream &t,const QCString &title) const +void DotGroupCollaboration::writeGraphHeader(TextStream &t,const QCString &title) const { int fontSize = Config_getInt(DOT_FONTSIZE); QCString fontName = Config_getString(DOT_FONTNAME); |