From 6540b260bd7c92ea0c61080fa7e98b7a38d5b6d3 Mon Sep 17 00:00:00 2001 From: dchandler Date: Sun, 22 Jun 2003 04:08:33 +0000 Subject: [PATCH] Fixes a (small, I think) TMW->Unicode performance glitch. I was inserting 5 characters at a time and then skipping ahead just one position. I don't think this affected correctness. I believe there's still a terrible (exponential?) slowdown as the input file gets bigger, however. Perhaps not -- but we run through the first 1000 TMW glyphs in 6 seconds, the 20th thousand takes at least 60 seconds. Is TMW->Wylie faster than TMW->Unicode? If so, why? Thought: don't use a DuffPane within TibetanConverter -- it can only add overhead, right? My hprof profile said that the conversion was taking just a couple of percent of the work; the rest was going to display-related stuff that you should only see if you were displaying the document. I'm not! --- source/org/thdl/tib/text/TibetanDocument.java | 1 + 1 file changed, 1 insertion(+) diff --git a/source/org/thdl/tib/text/TibetanDocument.java b/source/org/thdl/tib/text/TibetanDocument.java index c59b0f1..184a65b 100644 --- a/source/org/thdl/tib/text/TibetanDocument.java +++ b/source/org/thdl/tib/text/TibetanDocument.java @@ -735,6 +735,7 @@ public class TibetanDocument extends DefaultStyledDocument { if (replaceInsteadOfInserting()) { if (toUnicode) { replaceDuffWithUnicode(fontSize, i, unicode); + i += unicode.length() - 1; // we do i++ below } else { replaceDuff(fontSize, i, equivalent[0], !toTM); }