home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cs.utexas.edu!qt.cs.utexas.edu!yale.edu!ira.uka.de!uka!uka!news
- From: S_JUFFA@iravcl.ira.uka.de (|S| Norbert Juffa)
- Newsgroups: comp.lang.pascal
- Subject: Re: Why are set operations so Slow?
- Date: 12 Aug 1992 13:40:23 GMT
- Organization: University of Karlsruhe (FRG) - Informatik Rechnerabt.
- Lines: 29
- Distribution: world
- Message-ID: <16b4c7INN88n@iraul1.ira.uka.de>
- References: <Aug07.232901.50322@yuma.ACNS.ColoState.EDU> <Bstu1E.ArL@knot.ccs.queensu.ca>
- NNTP-Posting-Host: irav1.ira.uka.de
- X-News-Reader: VMS NEWS 1.23
- In-Reply-To: dmurdoch@QueensU.CA's message of Tue, 11 Aug 1992 16:05:38 GMT
-
- In <Bstu1E.ArL@knot.ccs.queensu.ca> dmurdoch@QueensU.CA writes:
-
- > In article <Aug07.232901.50322@yuma.ACNS.ColoState.EDU> mglacy@lamar.ColoState.EDU writes:
- > >Can someone explain why operations on set variables are so slow in
- > >TP6.0?
- >
- > Sets aren't that well implemented in TP. I think internally, all sets
- > are converted to 256 element sets before any operations are performed on
- > them; the result is converted back. Stoney Brook Pascal+ advertises
- > that they've optimized the set operations; I haven't tried it to see
- > whether you really get the speed increases that they claim.
- >
- Actually, when implementing my TPL60N15.ZIP fast TP 6.0 run time library
- replacement (available from garbo.uwasa.fi) I took a look at the set operations
- and how they could made faster. I found the set subroutines to be quite
- efficient with the exception of the add range operation Set := Set + [Lo..Hi].
- Since sets are stored with maximum compression ( [250..255] takes only one
- byte), I can't see how to avoid the expansion into a 32-byte buffer before
- every operation. What optimizing compiler's like SBP+ can easily speed up are
- tests like: ReadLn (Ch); IF Ch IN ValidChars THEN ..., where ValidChars is a
- SET OF CHAR with only very few set members. This can be optimize to a chain
- of IF...THEN...ELSEs and I am sure this is what SBP+ does. TP 7.0 is supposed
- to feature the same optimization.
-
- Norbert
- -------------------------------------------------------------------------------
- Norbert Juffa email: S_JUFFA@IRAVCL.IRA.UKA.DE Live and let live!
-
-
-