gzz-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gzz-commits] alph/org/nongnu/alph impl/StormAlph.java xml/se...


From: Tuomas J. Lukka
Subject: [Gzz-commits] alph/org/nongnu/alph impl/StormAlph.java xml/se...
Date: Wed, 13 Aug 2003 01:33:15 -0400

CVSROOT:        /cvsroot/alph
Module name:    alph
Branch:         
Changes by:     Tuomas J. Lukka <address@hidden>        03/08/13 01:33:15

Modified files:
        org/nongnu/alph/impl: StormAlph.java 
        org/nongnu/alph/xml: serialization.test 

Log message:
        Cache scrollblocks to avoid total trashing in FenPDF

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/impl/StormAlph.java.diff?tr1=1.7&tr2=1.8&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/alph/alph/org/nongnu/alph/xml/serialization.test.diff?tr1=1.13&tr2=1.14&r1=text&r2=text

Patches:
Index: alph/org/nongnu/alph/impl/StormAlph.java
diff -u alph/org/nongnu/alph/impl/StormAlph.java:1.7 
alph/org/nongnu/alph/impl/StormAlph.java:1.8
--- alph/org/nongnu/alph/impl/StormAlph.java:1.7        Wed Jun 11 13:50:18 2003
+++ alph/org/nongnu/alph/impl/StormAlph.java    Wed Aug 13 01:33:15 2003
@@ -29,6 +29,8 @@
 import org.nongnu.storm.*;
 import org.nongnu.storm.util.BlockTmpFile;
 
+import org.nongnu.navidoc.util.SoftValueMap;
+
 /** An Alph service implemented using Storm.
  */
 public class StormAlph extends Alph {
@@ -39,10 +41,22 @@
        this.stormPool = stormPool;
     }
 
+    SoftValueMap scrollBlocks = new SoftValueMap();
+
     public ScrollBlock getScrollBlock(String uri) {
+       ScrollBlock sb;
+       sb = (ScrollBlock)scrollBlocks.get(uri);
+       if(sb != null) return sb;
        BlockId id = new BlockId(uri);
+       sb = (ScrollBlock)scrollBlocks.get(id);
+       if(sb != null) return sb;
+
        String ct = id.getContentType();
-       ScrollBlock sb = AbstractScrollBlock.createBlock(this, id, ct);
+       sb = AbstractScrollBlock.createBlock(this, id, ct);
+
+       scrollBlocks.put(uri, sb);
+       scrollBlocks.put(id, sb);
+
        return sb;
     }
 
Index: alph/org/nongnu/alph/xml/serialization.test
diff -u alph/org/nongnu/alph/xml/serialization.test:1.13 
alph/org/nongnu/alph/xml/serialization.test:1.14
--- alph/org/nongnu/alph/xml/serialization.test:1.13    Fri Jun 27 07:30:09 2003
+++ alph/org/nongnu/alph/xml/serialization.test Wed Aug 13 01:33:15 2003
@@ -153,6 +153,7 @@
     assert 1 == java.lang.Character.isDefined(s.charAt(0))
     
     str = """<fts t="%s"/>""" % eq
+    print str
     parseString(str, r)
     sp = r.getSpans()[0]
     assert sp.getScrollId() == ""




reply via email to

[Prev in Thread] Current Thread [Next in Thread]