home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / lang / pascal / 4818 < prev    next >
Encoding:
Text File  |  1992-08-12  |  1.7 KB  |  33 lines

  1. Newsgroups: comp.lang.pascal
  2. Path: sparky!uunet!sun-barr!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
  3. From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
  4. Subject: Re: Why are set operations so Slow?
  5. Message-ID: <dmurdoch.5.713628912@mast.queensu.ca>
  6. Lines: 21
  7. Sender: news@knot.ccs.queensu.ca (Netnews control)
  8. Organization: Queen's University
  9. References: <Aug07.232901.50322@yuma.ACNS.ColoState.EDU> <Bstu1E.ArL@knot.ccs.queensu.ca> <16b4c7INN88n@iraul1.ira.uka.de>
  10. Date: Wed, 12 Aug 1992 14:15:13 GMT
  11.  
  12. In article <16b4c7INN88n@iraul1.ira.uka.de> S_JUFFA@iravcl.ira.uka.de (|S| Norbert Juffa) writes:
  13. >Since sets are stored with maximum compression ( [250..255] takes only one
  14. >byte), I can't see how to avoid the expansion into a 32-byte buffer before
  15. >every operation. What optimizing compiler's like SBP+ can easily speed up are
  16. >tests like: ReadLn (Ch); IF Ch IN ValidChars THEN ..., where ValidChars is a 
  17. >SET OF CHAR with only very few set members. This can be optimize to a chain 
  18. >of IF...THEN...ELSEs and I am sure this is what SBP+ does. TP 7.0 is supposed 
  19. >to feature the same optimization.
  20.  
  21. The claim I saw in the Stoney Brook pamphlet was that operations on sets 
  22. were converted to the equivalent bitwise operations when possible.  If S is 
  23. a set of 250..255, then S+[251] would be compiled to do a bitwise OR of 2 
  24. into S.  That's not a choice that was available to you in improving the RTL; 
  25. you'd have to go back further, and change the code generator.
  26.  
  27. I've been told that there are some people on Genie who have pretty well 
  28. dissected the TP code generator, so perhaps changes there would be possible.
  29. It would be hard to trust the results, though.
  30.  
  31. Duncan Murdoch
  32. dmurdoch@mast.queensu.ca
  33.