From ce92d363f43815a8dd59cb88f8ae0eff61c50261 Mon Sep 17 00:00:00 2001 From: "Christian P. MOMON" Date: Thu, 25 Feb 2010 16:19:28 +0100 Subject: [PATCH] Replace recursive concatenations StringBuffer by append in a single StringBuffer. Goal is performance. --- .../classes/fr/devinsy/xid/DomPresenter.class | Bin 2550 -> 2549 bytes .../fr/devinsy/xid/FilePresenter.class | Bin 3380 -> 3248 bytes build/classes/fr/devinsy/xid/Presenter.class | Bin 18117 -> 18483 bytes .../fr/devinsy/xid/StringPresenter.class | Bin 3156 -> 3263 bytes demo/XidDemo.java | 39 ++++--- src/fr/devinsy/xid/DomPresenter.java | 8 +- src/fr/devinsy/xid/FilePresenter.java | 30 +----- src/fr/devinsy/xid/Presenter.java | 97 +++++++++--------- src/fr/devinsy/xid/StringPresenter.java | 4 +- 9 files changed, 84 insertions(+), 94 deletions(-) diff --git a/build/classes/fr/devinsy/xid/DomPresenter.class b/build/classes/fr/devinsy/xid/DomPresenter.class index 0a5a7e09cde3268d51eb0d4a04b039f3c3052a7c..b1eb8b03e4110fa3878a8141fc35b26d7b64bb5b 100644 GIT binary patch delta 362 zcmYL@J4*vW6otRpoi&>^N^~JaSTSk}AMt?-L9r7Hi$HvBjBgQ3iI~Phv{cY;{)4rm zpeXnQ1nvD1HUTZgyGg()<{r-d&dmAozkToR_xTl=VDHW=>6RFaij?_qQocu#jEBui zf;_8=!hm^q(x##(b*Ko;nH`u3AWf)#EypaT|Bb?GL-V{!hrJt9+9$1USD-dy`u5yElorsv)^Rfo%gxKvrw{v6I`@31 zXp}YYL;iKp$3$*`@>>3ZGYdX-94YD4FuB5J@F!+?x0wxYR#Hy)#kb<~~l&J@?$Zli5nU-+q1k0`#%I?T$Nf%@sw; z^y}1^%Som@rWsSjCo9v{;F8M)W;|w@QzR?%!R4umpmOo-#9Xx!3`Y!wogeBQbg2<| zbg&QtgT3W&^16r5qN0>H19qD^qaE|ZPMJ05kX=?}rO29}PSw7z$e48}6Voi4TKtsj zqUaC9!xwr+Ju|avk*g2AjC}-!|V9uX;XFJD0W_Ozv{^1M{U~VTZ&1F4u}% z!ikZRSSD#!-O|zq3%p~IgMytW5o*vyx8$%o!427$!==DYEJpXL4fg%T95%T{ljyea zmfPGBFCDaVS1^aud)1OCrm=rh#L+0tJv1#3wEUO8ww&ztSushkbEIA>ss^jWerVT< z?CuwNSQb)U);x;r9*MA4j>#efwIV}GI8DOnmOhkxY*xI^Tz%xYFOsF`1OH1JA-$C0 o*XFC&)f3+MZ#;HjfILs+{$`OsDp^T(3Jso`*5<5!E}g~NAI@@REC2ui delta 693 zcmYk3&1(};6vfY*$;?Y8v9V2P%}_N-{Roq(!MYMbP`lD33qf#EL2Xj0HchQFx_R&3%YDCl&V9|qmTi6e{bd`#7@mHz zE*gCnF5p@OS#Y%a0LE^5e7>SsGS*o6&E{$0bIPM(}R8r1~hFX)SMfmd% z8P`G$1YlCpJM}B{YRK8b-fSCJ3vQD&9fLg2BCc9ip}v6{hL}$v|3iJlVeI6;56y zv4K83qu1vc#!KI$LpEu+Np(P&Y-gO-1RJ`B1fM35qG=7Db(VYsLRVF z?)W*!+{3b33#W?pf-73M-_@h}JLXG5UbE>f_p|A1Ncy#Y9Pl+ndxJyFSGar4-^IiA zNGe?~j%G>h{@VY<5A69!VpE-pj2!g-=I?8L=Lux!Uikal&s$J|;k58by@(9U$ILW5 F`2*i#Y=r;- diff --git a/build/classes/fr/devinsy/xid/Presenter.class b/build/classes/fr/devinsy/xid/Presenter.class index 5108013373be0acb90ed675219737687479e0abc..ff98787a9b02f25ceb24032ef24b7714c1f23860 100644 GIT binary patch literal 18483 zcmcJ034B!5_5V5d&7McdLV!WQfDuC$!lDrp79j)}&4MHlmLg6v0~t+bFqsIkiyLmW z+Sa0#YOAO<#oE@Y4M}mKRl((FYd5M^tzE3$TWxI>f&9PczBiM}BysuwK0iLp%zbw~ z_uO;7XSpxWp7{P_L^M}@%}t7F;?|C`Q263Vw6nWxXCzd%x+B~fj>f|sZgMbXT@buD z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}NK;%N<29IbIshCrZhoYl*RRvUGWu zZN@IS^f>tdAqomJ*4uX7)sF@^N>S0LN3F0+L*MCCl z@Uay}^p>wDI@WE5&9Bs{z6JKU?6A4aWZ&`kVqwrA_f10jw9{HnGDC_vGR%|Z6**p$ zXMqBXjId6T&rGn%6kANQE$kgC1jQkR;|@d%ha|e$DPbvI$_r8M;$fqfeXnIZ(*KK| zmELrjItc^p7jrk8VUT+wHsr|$?n}?)ftdH>J7ZUA#I#Yi&}_P(%04{14JnTNhsNQg z`HOntRq_1;Y~pgn&nG`zmQnOo|3URg7yX^8qTl%st0(%4zq`ZTqrNt&PsVsETN-iDv4J65_7sE&}=`K%EOC4Ir@7y delta 554 zcmYL_&r4KM6vsdJ{q$X5OhpcFq^OVyF=0@mNOB>xaFNnVs#Vs!$v5g$GdkmxHqfg5 zZRtX3(I!GE8YwYa6^YQIUHua++C}4;tO+jne9!rw?>XOl-)Fu?`t$F%JHRlFO}*y~ zYNomEb4w8w%DH@8O-hw|ZYjya0v_??~xxdE;KSJ*8%Tcr~^BD)C1xt$yO*ij_UH5fp=g z*JRFaadXm~*JIgu#K|}x=~5HVIrNU?dd6uoJ2AK+{Wizso}$OB>b^#S3NzFwvdkP$ znCB@a*0{?H?z71vO<}jG^MMt1c}$O}3+VP{PI5|O8=Vuik}jL9%&>UbK|39^EA<2R zlGI9cVK=zO(E}((Zphksp_*dxp3sh1fJuT2ev1glNBNZTxd<(eVErxpN&d45 bj|akai#RJ$NpuI^@X)M=$Nd$_EFSFxyFF=1 diff --git a/demo/XidDemo.java b/demo/XidDemo.java index 43f795c..ab72782 100644 --- a/demo/XidDemo.java +++ b/demo/XidDemo.java @@ -44,22 +44,24 @@ class XidDemo datas = new Data (); datas.setContent ("name", "Superman"); - StringBuffer html; + String htmlSource = "
a name
"; + StringBuffer htmlTarget; try { - html = StringPresenter.doXid ("
a name
", datas); + htmlTarget = StringPresenter.doXid (htmlSource, datas); } catch (Exception exception) { System.out.println(exception.getMessage()); - html = null; + htmlTarget = null; } System.out.println ("datas = new Data ();"); System.out.println ("datas.setContent (\"name\", \"Superman\");"); System.out.println ("+"); System.out.println ("
a name
"); System.out.println ("=>"); - System.out.println (html); + System.out.println (htmlTarget); + System.out.println ("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]"); } @@ -73,15 +75,16 @@ class XidDemo datas.appendAttribute ("lastname", "style", "foreground: red;"); datas.setAttribute ("lastname", "class", "nameClass"); - StringBuffer html; + String htmlSource = "
a last name
"; + StringBuffer htmlTarget; try { - html = StringPresenter.doXid ("
a last name
", datas); + htmlTarget = StringPresenter.doXid (htmlSource, datas); } catch (Exception exception) { System.out.println(exception.getMessage()); - html = null; + htmlTarget = null; } System.out.println ("datas = new Data ();"); @@ -92,7 +95,8 @@ class XidDemo System.out.println ("+"); System.out.println ("
a last name
"); System.out.println ("=>"); - System.out.println (html); + System.out.println (htmlTarget); + System.out.println ("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]"); } @@ -108,15 +112,16 @@ class XidDemo datas.setContent ("words", 4, "echo"); datas.setContent ("words", 5, "fox"); - StringBuffer html; + String htmlSource = "
    \n
  • a word
  • \n
"; + StringBuffer htmlTarget; try { - html = StringPresenter.doXid ("
    \n
  • a word
  • \n
", datas); + htmlTarget = StringPresenter.doXid (htmlSource, datas); } catch (Exception exception) { System.out.println(exception.getMessage()); - html = null; + htmlTarget = null; } System.out.println ("datas = new Data ();"); @@ -131,7 +136,8 @@ class XidDemo System.out.println ("
  • a word
  • "); System.out.println (""); System.out.println ("=>"); - System.out.println (html); + System.out.println (htmlTarget); + System.out.println ("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]"); } @@ -154,15 +160,15 @@ class XidDemo source.append (""); String htmlSource = source.toString (); - StringBuffer html; + StringBuffer htmlTarget; try { - html = StringPresenter.doXid (htmlSource, datas); + htmlTarget = StringPresenter.doXid (htmlSource, datas); } catch (Exception exception) { System.out.println(exception.getMessage()); - html = null; + htmlTarget = null; } System.out.println ("datas = new Data ();"); @@ -176,7 +182,8 @@ class XidDemo System.out.println ("+"); System.out.println (htmlSource); System.out.println ("=>"); - System.out.println (html); + System.out.println (htmlTarget); + System.out.println ("[" + htmlSource.length() + "] => [" + htmlTarget.length() + "]"); } diff --git a/src/fr/devinsy/xid/DomPresenter.java b/src/fr/devinsy/xid/DomPresenter.java index cd678a4..a79d0da 100644 --- a/src/fr/devinsy/xid/DomPresenter.java +++ b/src/fr/devinsy/xid/DomPresenter.java @@ -116,7 +116,8 @@ public class DomPresenter extends Presenter else { // Build the web page. - result = Presenter.doXid (this.doc, datas); + result = new StringBuffer (); + Presenter.doXid (result, this.doc, datas); } // @@ -127,11 +128,12 @@ public class DomPresenter extends Presenter /* * Xid a file with data. */ - static public StringBuffer doXid (Document doc, IdsDataById datas, String webappPath) throws Exception + static public StringBuffer doXid (Document doc, IdsDataById datas) throws Exception { StringBuffer result; - result = Presenter.process (doc, datas, webappPath); + result = new StringBuffer(); + Presenter.process (result, doc, datas); // return (result); diff --git a/src/fr/devinsy/xid/FilePresenter.java b/src/fr/devinsy/xid/FilePresenter.java index a3e4eda..9bf879b 100644 --- a/src/fr/devinsy/xid/FilePresenter.java +++ b/src/fr/devinsy/xid/FilePresenter.java @@ -113,7 +113,8 @@ public class FilePresenter extends DomPresenter } // Build the web page. - result = Presenter.doXid (doc, datas); + result = new StringBuffer (Presenter.estimatedTargetLength(source.length())); + Presenter.doXid (result, doc, datas); // return (result); @@ -123,32 +124,7 @@ public class FilePresenter extends DomPresenter /* * Xid a file without data. */ - static public StringBuffer doXid (String fileName) throws Exception - { - StringBuffer result; - - Document doc = Presenter.fileToTree (fileName); - - if (doc == null) - { - result = null; - } - else - { - Presenter.addMetaTag (doc, "generator", "XID 0.0"); - - result = Presenter.doXid (doc, null); - } - - // - return (result); - } - - - /* - * Xid a file without data. - */ - static public StringBuffer doXid2 (String filePathname) throws Exception + static public StringBuffer doXid (String filePathname) throws Exception { StringBuffer result; diff --git a/src/fr/devinsy/xid/Presenter.java b/src/fr/devinsy/xid/Presenter.java index c12bf52..19c24e6 100644 --- a/src/fr/devinsy/xid/Presenter.java +++ b/src/fr/devinsy/xid/Presenter.java @@ -25,14 +25,9 @@ public class Presenter /* * Xid a file with data. */ - static public StringBuffer doXid (Document doc, IdsDataById datas) throws Exception + static public void doXid (StringBuffer result, Document doc, IdsDataById datas) throws Exception { - StringBuffer result; - - result = Presenter.process (doc, datas); - - // - return (result); + Presenter.process (result, doc, datas); } @@ -117,27 +112,20 @@ public class Presenter /* * */ - static protected StringBuffer processChildren (Node node, IdsDataById datas) throws Exception + static protected void processChildren (StringBuffer result, Node node, IdsDataById datas) throws Exception { - StringBuffer result; - - result = processChildren (node, datas, ""); - - // - return (result); + processChildren (result, node, datas, ""); } /* * */ - static protected StringBuffer processChildren (Node node, + static protected void processChildren (StringBuffer result, + Node node, IdsDataById datas, String suffix) throws Exception { - StringBuffer result; - result = new StringBuffer (); - // Get the iteration strategy. IdData.IterationStrategy strategy; @@ -189,12 +177,12 @@ public class Presenter lineCounter += 1; if (lineCounter == 1) { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } else { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } break; @@ -209,12 +197,12 @@ public class Presenter if ((lineCounter == 1) || (lineCounter == 2)) { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } else { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } break; @@ -229,12 +217,12 @@ public class Presenter if ((attrs2 != null) && (attrs2.getNamedItem ("id") != null)) { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } else { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } break; @@ -248,12 +236,12 @@ public class Presenter if ((attrs2 == null) || (attrs2.getNamedItem ("id") == null)) { - result.append (process (children.item(childIndex), datas, suffix)); + process (result, children.item(childIndex), datas, suffix); } } else { - result.append (process (children.item (childIndex), datas, suffix)); + process (result, children.item (childIndex), datas, suffix); } } break; @@ -261,13 +249,10 @@ public class Presenter case ALL_ROWS: for (int childIndex = 0; childIndex < childrenCount; childIndex++) { - result.append (process (children.item(childIndex), datas, suffix)); + process (result, children.item(childIndex), datas, suffix); } break; } - - // - return (result); } @@ -370,7 +355,7 @@ public class Presenter if ((data == null) || (data.display () == null)) { - result.append (processChildren (node, datas, suffix)); + processChildren (result, node, datas, suffix); } else { @@ -417,7 +402,7 @@ public class Presenter // Insert data. if ((data == null) || (data.display () == null)) { - result.append (processChildren (node, datas, suffix)); + processChildren (result, node, datas, suffix); } else { @@ -455,14 +440,9 @@ public class Presenter /** * */ - static protected StringBuffer process (Node node, IdsDataById datas) throws Exception + static protected void process (StringBuffer result, Node node, IdsDataById datas) throws Exception { - StringBuffer result; - - result = Presenter.process (node, datas, ""); - - // - return (result); + Presenter.process (result, node, datas, ""); } @@ -470,16 +450,13 @@ public class Presenter * Recursive method that processes a node and any child nodes. * */ - static protected StringBuffer process (Node node, IdsDataById datas, String suffix) throws Exception + static protected void process (StringBuffer result, Node node, IdsDataById datas, String suffix) throws Exception { logger.debug ("process - started"); String TRANSITIONAL_DTD = "xhtml1-transitional.dtd"; String TRANSITIONAL_DOCTYPE = "\n"; - StringBuffer result; - result = new StringBuffer (); - // Is there anything to do? if (node != null) { @@ -514,7 +491,7 @@ public class Presenter // Log.write(Log.TRACE,"systemId = " + systemId); } - result.append (Presenter.process (((Document) node).getDocumentElement(), datas, suffix)); + Presenter.process (result, ((Document) node).getDocumentElement(), datas, suffix); break; } @@ -596,7 +573,6 @@ public class Presenter // //logger.info ("result=" + result); logger.debug ("process - ended"); - return (result); } @@ -644,7 +620,7 @@ public class Presenter { result.append('>'); - result.append (processChildren (node, datas, suffix)); + processChildren (result, node, datas, suffix); result.append("