AW: How do you handle the poor performance of LC 7?

Richard Gaskin ambassador at fourthworld.com
Sat May 30 11:17:01 EDT 2015


Thanks for sending your stack to the team.  Please let us know the outcome.

And thanks for posting that handler.  Mike and Richard already hit on 
the only two items that come to mind (sorting and filtering), but I'm 
curious:  How does performance look if you comment out the call to 
xSortListe?

I wish I had time this morning to run some benchmarking between a loop 
through an array as you have here and a filter on a pre-sorted list, but 
my hunch is the latter would take care of a lot of that performance for you.

If you have time to run a quick benchmark on that handler with and 
without the xSortListe call commented, I would be very interested in the 
results.

-- 
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  ____________________________________________________________________
  Ambassador at FourthWorld.com                http://www.FourthWorld.com


Tiemo Hollmann wrote:

 > Hi Richard,
 >
 > the scenario is a field to enter a search term. With each entered
 > character (keyUp) or each backspace (rawKeyUp) correcting the search
 > term I call the following selecting routine to get a "live selection"
 > of my 20,000 record list of words. In LC 6 I can enter the chars as
 > fast as I want and this handler is always "on time" to show me the
 > result list. In LC 7.0.5 it swallows the entered chars, can't catch
 > up until it stucks completely. I am not talking of a slow down of 10
 > or 50%. I am talking about a slow down of some x100%, which makes the
 > complete handling unacceptable. Maybe my code isn't very
 > professional, so feel free to show up better style. I have send
 > Hanson my original real live stack.
 > Tiemo
 >
 > Here is the relevant piece of code:
 >
 >    repeat for each key tKey in garrVideos -- alle Begriffe und Sätze
 > durchgehen
 >       if gAktRubrik <> 99 and gAktRubrik is not item 2 of 
garrVideos[tKey]
 > then next repeat -- falsche Rubrik
 >       if tBegriffFlag is not item 6 of garrVideos[tKey] then next 
repeat --
 > falsche Kategorie Begriffe
 >       if gMenuAktuell is "Bearbeiten" and tKey is in 
tLernlistenInhalt then
 > next repeat -- Begriff schon in Lernliste
 >       if tSuchbegriff is empty then -- kein Suchbegriff, Begriff/Satz
 > übernehmen
 >          put tKey & cr after tListe
 >       else -- nach Suchbegriff selektieren
 >          if tSuchenBeliebig is true then -- an beliebiger Stelle im Wort
 > suchen
 >             if tKey contains tSuchbegriff then -- Wort/Satz enthält
 > Suchbegriff
 >                put tKey & cr after tListe
 >             end if
 >          else -- Suchbegriff nur am Anfang des Wortes
 >             if tKey begins with tSuchbegriff then -- Wort/Satz 
beginnt mit
 > Suchbegriff
 >                put tKey & cr after tListe
 >             end if
 >          end if
 >       end if
 >    end repeat
 >    if tListe is not empty then delete last char of tListe   -- letzten CR
 > löschen
 >    put xSortListe(tListe) into fld "Liste" -- Text ins Anzeigefeld 
kopieren






More information about the use-livecode mailing list