home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4816 next >
Encoding:
Internet Message Format  |  1992-08-12  |  2.1 KB

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