home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / mac / hypercar / 3386 < prev    next >
Encoding:
Internet Message Format  |  1992-09-08  |  1.8 KB

  1. From: Henry.M..Halff@p932.f70.n109.z1.fidonet.org (Henry M. Halff)
  2. Sender: Uucp@blkcat.UUCP
  3. Path: sparky!uunet!blkcat!Uucp
  4. Newsgroups: comp.sys.mac.hypercard
  5. Subject: Help needed for container search!!!
  6. Message-ID: <715979162.F00002@blkcat.UUCP>
  7. Date: Mon, 07 Sep 1992 13:46:54 -0500
  8. Lines: 33
  9.  
  10. Mark C. Langston to All about "Help needed for container search!!!" at 1:41:18
  11. AM on  9/7/92
  12.  
  13.   MC> The user selects a boldface word group from the main field, and the
  14.   MC> background script searches through a container for the selected word
  15.   MC> group, so it can display a set of branching options to the user in the
  16.   MC> 2 smaller fields.
  17.   MC> 
  18.   MC> I'm currently using an XFCN called SEARCH to do this, but there is a
  19.   MC> problem:  it seems to be dreadfully slow when searching (the
  20.   MC> containers are quite large, on the order of several thousand words to
  21.   MC> search through, each with their respective data structures for
  22.   MC> branching options.)
  23.   MC> 
  24.   MC> The entire process should (due to experimental and theoretical
  25.   MC> boundaries) take place in roughly 30 seconds.  However, one could
  26.   MC> easily see how the script could take much longer, if the desired word
  27.   MC> is at the bottom of a 3000+ word list in a container.
  28.  
  29. Your XFCN may be the culprit here. I created a 3000 word global (one word per
  30. line) and measured the amount of time that it took HyperCard's offset function
  31. to find a randomly generated target in the list. The average turns out to be
  32. less than 1/2 tick (actually about .42 ticks) on my IIci. The conditions aren't
  33. exactly the same as yours, but the result suggests that the straightforward
  34. approach could be faster.
  35.  
  36. Here are some suggestions for speeding things up.
  37.  
  38. 1. Increase memory allocation for HyperCard.
  39.  
  40. 2. Make sure that your containers are variables, not fields.
  41.  
  42. 3. Sort the containers so that you can do a binary search.
  43.