RE: Slow reading of TextModels

From: [at]} <weck{>
Date: Sat, 18 Nov 2000 11:41:12 +0100

> I use the procedure in ObxAscii to read a TextModel (ie.
> Converters.Import to get a View


> Why does it take so long to open a TextModel for reading? I'm guessing
> that the framework makes a backup copy of every object that is opened.
> It possibly also needs to read the whole file to Import it. Is there a
> way to open a TextModel that avoids some of this overhead?


You need to distinguish between text files (typically .txt) and BlackBox documents (.odc) containing
text. In text files there is nothing else than a sequence of characters and hence you cannot embed
other views, use attributes, and so on. BlackBox documents are a recursive structure of views, some
of which may be TextViews presenting a TextModel. BlackBox documents are stored in a different file
format than plain text.

Though using a text file as the basis of a TextModel may seem trivial from the outside it is not.
The file-based piece list editor relies on the file being in the BlackBox document format. Hence, if
you want to represent data of a text file through a TextModel, you need to convert it first. This is
what the above mentioned call to Converters.Import effectively does. The conversion implies to
generate a document file containing all the data from the text file, which means indeed, that the
entire text needs to be read and copied.

If you need to access the same texts often, it may pay of to convert them once and store the
resulting BlackBox text documents. (That is, you would need to store the View the converter
generated for you.) This will open much faster in BlackBox because it does not need conversion

An alternative is indeed to access text files directly through the file abstraction instead of the
text abstraction, thus avoiding conversion to a BlackBox document as well.

All the best,
        Wolfgang Weck

Dr. Wolfgang Weck
Oberon microsystems Inc.
Technoparkstrasse 1, CH-8005 Zürich
Tel: (+41 1) 445 17 51, Fax: (+41 1) 445 17 52


To unsubscribe from this mailing list, send a message containing the word "unsubscribe" to:

To get a list of valid e-mail commands and instructions on their usage, send a message containing the word "help" to the above address.

Send any problem reports or questions related to this email list to the list owner at
Received on Sat Nov 18 2000 - 10:41:12 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:27:45 UTC