cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
%3CLINGO-SUB%20id%3D%22lingo-sub-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3EOttimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECiao%20comunit%C3%A0%20JMP%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EUltimamente%2C%20stavo%20cercando%20di%20migliorare%20le%20prestazioni%20dei%20miei%20script%20JSL%20interni%20e%20ho%20riscontrato%20i%20seguenti%20problemi%20di%20prestazioni%20che%20vorrei%20risolvere.%3C%2FP%3E%3CP%3EPrendiamo%20il%20seguente%20script%20(JMP%2017.2%20PRO%20in%20esecuzione%20su%20macOS)%3A%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(%201%20)%3B%0Adt%20%3D%20Open(%20%22%24SAMPLE_DATA%2FBig%20Class.jmp%22%20)%3B%0A%0Avalues%20%3D%20Column(%20dt%2C%201%20)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(%20Excluded(%20Row%20State()%20)%20!%3D%201%20)%5D%3B%0Anew%20window(%22test%22%2C%20%0A%09lb%20%3D%20list%20box(%20values%2C%20nlines(10)%2C%20width(100)%2C%20)%2C%0A%09b%20%3D%20button%20box(%22reset%22%2C%20reset_lb)%2C%0A%09)%3B%0A%09%0Areset_lb%20%3D%20expr(%0A%09lb%20%26lt%3B%26lt%3B%20remove%20all()%3B%0A%09lb%20%26lt%3B%26lt%3B%20append(values)%3B%0A%09%0A%09Nnames%20%3D%20N%20Items(values)%3B%0A%09for(i%20%3D%201%2C%20i%20%26lt%3B%3D%20Nnames%2C%20i%2B%2B%2C%0A%09%09lb%20%26lt%3B%26lt%3B%20set%20selected(i)%3B%0A%09)%3B%0A)%3B%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3EIn%20alcuni%20dei%20miei%20script%20utilizzo%20caselle%20di%20riepilogo%20aggiornate%20dinamicamente.%20Per%20modificare%20il%20contenuto%20delle%20caselle%20di%20riepilogo%20utilizzo%20le%20funzioni%20%3CSTRONG%3E%26lt%3B%3CREMOVE%3E%20e%20%3CSTRONG%3E%26lt%3B%3CAPPEND%3E%20%2C%20funzionano%20bene%20ma%20temo%20che%20questo%20metodo%20non%20si%20adatti%20molto%20bene%20al%20numero%20di%20righe%2C%20un'altra%20parte%20che%20sorprendentemente%20funziona%20molto%20lentamente%20%C3%A8%20il%20ciclo%20for%20con%20%3CSTRONG%3E%26lt%3B%26lt%3B%20set%20selezionato()%2C%3C%2FSTRONG%3E%20apparentemente%20questo%20%C3%A8%20l'unico%20metodo%20che%20ho%20trovato%20per%20selezionare%20tutti%20gli%20elementi%20in%20una%20casella%20di%20riepilogo%20ma%20si%20adatta%20terribilmente%20con%20il%20numero%20di%20righe.%3C%2FAPPEND%3E%3C%2FSTRONG%3E%3C%2FREMOVE%3E%3C%2FSTRONG%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3ELa%20mia%20domanda%20%C3%A8%20se%20esistono%20modi%20migliori%20per%20aggiornare%20il%20contenuto%20delle%20caselle%20di%20riepilogo%20che%20non%20rallentino%20le%20prestazioni.%20Sto%20cercando%20possibili%20alternative%20che%20farebbero%3A%3C%2FP%3E%3COL%3E%3CLI%3Emetodo%20ottimale%20per%20impostare%20il%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLI%3E%3CLI%3Emodo%20rapido%20per%20selezionare%20tutti%20gli%20elementi%20della%20casella%20di%20riepilogo.%3C%2FLI%3E%3C%2FOL%3E%3CP%3EQualsiasi%20feedback%20o%20suggerimento%20sarebbe%20molto%20apprezzato.%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-749312%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CLINGO-LABEL%3EAutomazione%20e%20scripting%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EEsplorazione%20e%20visualizzazione%20dei%20dati%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMac%20OS%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749336%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ERi%3A%20Ottimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749336%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CP%3EQuanti%20elementi%20prevedi%20di%20avere%20nella%20casella%20di%20riepilogo%3F%20Per%201%20c'%C3%A8%20%26lt%3B%26lt%3B%20Imposta%20elementi()%20che%20puoi%20usare%3C%2FP%3E%0A%3CP%3E%20%3C%2FP%3E%0A%3CP%3EModificare%3A%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-byline-wrapper%22%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.jmp.com%2Ft5%2FJMP-Wish-List%2FCan-the-listbox-have-a-select-all-command%2Fm-p%2F670072%23U670072%22%20class%3D%22lia-mention-container-editor-message%20lia-img-icon-idea-thread%20lia-fa-icon%20lia-fa-idea%20lia-fa-thread%20lia-fa%22%20target%3D%22_blank%22%3ELa%20casella%20di%20riepilogo%20pu%C3%B2%20avere%20un%20elemento%20della%20lista%20dei%20desideri%20dei%20comandi%20Seleziona%20tutto%3C%2FA%3E%20nello%20stato%20%22Ci%20piace!%20(in%20coda)%22.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749337%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERi%3A%20Ottimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749337%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3ECiao%20Jarmo%2C%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EGrazie%20per%20la%20risposta%2C%20prover%C3%B2%20a%20utilizzare%20%26lt%3B%26lt%3B%20Set%20Items()%20e%20controller%C3%B2%20se%20%C3%A8%20pi%C3%B9%20veloce%20di%20%26lt%3B%20%3CREMOVE%20all%3D%22%22%3E%3C%2FREMOVE%3E%3C%2FP%3E%3CP%3E%20%3C%2FP%3E%3CP%3EPer%20quanto%20riguarda%20il%20numero%20di%20elementi%2C%20si%20tratta%20di%20circa%20~%2030k%2C%20la%20cosa%20strana%20%C3%A8%20che%20quando%20carico%20lo%20script%20ci%20vuole%20molto%20meno%20per%20popolare%20lb%20da%20zero%20rispetto%20ad%20aggiornare%20i%20contenuti%2C%20stavo%20pensando%20come%20metodo%20per%20eliminare%20le%20caselle%20di%20riepilogo%20e%20poi%20crearli%20di%20nuovo%2C%20ma%20potrebbe%20essere%20piuttosto%20difficile%20apportare%20tutte%20queste%20modifiche%20negli%20script.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERi%3A%20Ottimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749339%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EEntrambi%20questi%20metodi%20sembrano%20abbastanza%20veloci%20secondo%20me%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Arowcount%20%3D%20100000%3B%0A%0Adt%20%3D%20New%20Table(%22Demo%22%2C%0A%09Add%20Rows(rowcount)%2C%0A%09New%20Column(%22Values%22%2C%20Character%2C%20Nominal%2C%20%26lt%3B%26lt%3B%20Set%20Each%20Value(%0A%09%09Hex(Row())%20%7C%7C%20Hex(Row())%20%7C%7C%20Hex(Row())%0A%09))%0A)%3B%0A%0Avalues%20%3D%20Column(dt%2C%201)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(Excluded(Row%20State())%20!%3D%201)%5D%3B%0AClose(dt%2C%20no%20save)%3B%0A%0Anw%20%3D%20New%20Window(%22test%22%2C%0A%09H%20List%20Box(%0A%09%09H%20List%20Box(%0A%09%09%09lb1%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100))%2C%0A%09%09%09Button%20Box(%22reset%22%2C%20reset_lb1)%2C%09%09%09%0A%09%09)%0A%09)%2C%0A%09H%20List%20Box(%0A%09%09H%20List%20Box(%0A%09%09%09lb2_collector%20%3D%20V%20List%20Box(%0A%09%09%09%09lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100))%2C%0A%09%09%09)%2C%0A%09%09%09Button%20Box(%22reset2%22%2C%20reset_lb2)%2C%09%09%09%0A%09%09)%0A%09)%0A)%3B%0A%09%0Areset_lb1%20%3D%20Expr(%0A%09start1%20%3D%20HP%20Time()%3B%0A%09lb1%20%26lt%3B%26lt%3B%20Set%20Items(values)%3B%0A%09end1%20%3D%20HP%20Time()%3B%0A%09start2%20%3D%20end1%3B%0A%09Nnames%20%3D%20N%20Items(values)%3B%0A%09For(i%20%3D%201%2C%20i%20%26lt%3B%3D%20Nnames%2C%20i%2B%2B%2C%0A%09%09lb1%20%26lt%3B%26lt%3B%20set%20selected(i)%3B%0A%09)%3B%0A%09end2%20%3D%20HP%20Time()%3B%0A%09Show((end1%20-%20start1)%2F1e6%2C%20(end2-start2)%2F1e6%2C%20(end2-start1)%2F1e6)%3B%0A)%3B%0A%0Areset_lb2%20%3D%20Expr(%0A%09start3%20%3D%20HP%20Time()%3B%0A%09vlb%20%3D%20V%20List%20Box(lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)))%3B%0A%09For%20Each(%7Bval%2C%20idx%7D%2C%20values%2C%0A%09%09lb2%20%26lt%3B%26lt%3B%20set%20selected(idx)%3B%0A%09)%3B%0A%09While(!IsEmpty(lb2_collector%20%26lt%3B%26lt%3B%20child)%2C%0A%09%09(lb2_collector%20%26lt%3B%26lt%3B%20child)%20%26lt%3B%26lt%3B%20delete%20box%3B%0A%09)%3B%0A%09lb2_collector%20%26lt%3B%26lt%3B%20Append(vlb)%3B%0A%09end3%20%3D%20HP%20Time()%3B%0A%09Show((end3%20-%20start3)%2F1e6)%3B%0A)%3B%0A%0AWrite()%3B%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749349%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERi%3A%20Ottimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749349%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EUna%20cosa%20da%20notare%20%C3%A8%20che%20%26lt%3B%26lt%3B%20Imposta%20selezionato%20eseguir%C3%A0%20lo%20script%20associato%20alla%20casella%20di%20riepilogo%20(se%20presente)%20per%20impostazione%20predefinita.%20Se%20hai%20uno%20script%20associato%20ma%20non%20vuoi%20che%20si%20attivi%20con%20ogni%20set%2C%20usa%20%26lt%3B%26lt%3B%20Set%20Selected(idx%2C%201%2C%20Run%20Script(0))%20(puoi%20attivarlo%20sull'ultimo%20set%20se%20necessario)%3C%2FP%3E%0A%3CPRE%3E%3CCODE%20class%3D%22%20language-jsl%22%3ENames%20Default%20To%20Here(1)%3B%0A%0Arowcount%20%3D%20100000%3B%0A%0Adt%20%3D%20New%20Table(%22Demo%22%2C%0A%09Add%20Rows(rowcount)%2C%0A%09New%20Column(%22Values%22%2C%20Character%2C%20Nominal%2C%20%26lt%3B%26lt%3B%20Set%20Each%20Value(%0A%09%09Hex(Row())%20%7C%7C%20Hex(Row())%20%7C%7C%20Hex(Row())%0A%09))%0A)%3B%0A%0Avalues%20%3D%20Column(dt%2C%201)%5Bdt%20%26lt%3B%26lt%3B%20get%20rows%20where(Excluded(Row%20State())%20!%3D%201)%5D%3B%0AClose(dt%2C%20no%20save)%3B%0A%0Anw%20%3D%20New%20Window(%22test%22%2C%0A%09H%20List%20Box(%0A%09%09lb2_collector%20%3D%20V%20List%20Box(%0A%09%09%09lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)%2C%20Show(1))%2C%0A%09%09)%2C%0A%09%09Button%20Box(%22reset2%22%2C%20reset_lb2)%2C%09%09%09%0A%09)%0A)%3B%0A%09%0Areset_lb2%20%3D%20Expr(%0A%09start3%20%3D%20HP%20Time()%3B%0A%09vlb%20%3D%20V%20List%20Box(lb2%20%3D%20List%20Box(values%2C%20nlines(10)%2C%20width(100)%2C%20Show(1)))%3B%0A%09For(i%20%3D%201%2C%20i%20%26lt%3B%20N%20Items(values)%2C%20i%2B%2B%2C%0A%09%09lb2%20%26lt%3B%26lt%3B%20set%20selected(i%2C%201%2C%20Run%20Script(0))%3B%0A%09)%3B%0A%09lb2%20%26lt%3B%26lt%3B%20set%20selected(N%20Items(values)%2C%201%2C%20Run%20Script(1))%3B%0A%0A%09While(!IsEmpty(lb2_collector%20%26lt%3B%26lt%3B%20child)%2C%0A%09%09(lb2_collector%20%26lt%3B%26lt%3B%20child)%20%26lt%3B%26lt%3B%20delete%20box%3B%0A%09)%3B%0A%09lb2_collector%20%26lt%3B%26lt%3B%20Append(vlb)%3B%0A%09end3%20%3D%20HP%20Time()%3B%0A%09Show((end3%20-%20start3)%2F1e6)%3B%0A)%3B%0A%0AWrite()%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-749353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ERi%3A%20Ottimizzazione%20dell'aggiornamento%20del%20contenuto%20della%20casella%20di%20riepilogo.%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-749353%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EGrazie%20mille%20per%20la%20dimostrazione.%20Sulla%20mia%20macchina%20il%20secondo%20metodo%20%C3%A8%20circa%205%20volte%20pi%C3%B9%20veloce%20e%2C%20come%20puoi%20vedere%2C%20la%20maggior%20parte%20del%20tempo%20del%20primo%20metodo%20viene%20impiegato%20per%20il%20ciclo%20selezionato%20impostato.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Choose Language Hide Translation Bar

Optimizing list box content update.

Hello JMP community,

 

Lately, I was looking into improve the performance of my internal JSL scripts and I found the following performance issues that I would like to address.

Lets take the following script (JMP 17.2 PRO running on macOS):

 

Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );

values = Column( dt, 1 )[dt << get rows where( Excluded( Row State() ) != 1 )];
new window("test", 
	lb = list box( values, nlines(10), width(100), ),
	b = button box("reset", reset_lb),
	);
	
reset_lb = expr(
	lb << remove all();
	lb << append(values);
	
	Nnames = N Items(values);
	for(i = 1, i <= Nnames, i++,
		lb << set selected(i);
	);
);

In some of my scripts I am using list boxes that are dynamically updated. For changing the content of the list boxes I use the << remove() and << append() functions, they work just fine but I am afraid that this method does not scale very well with the number of rows, another portion that surprisingly runs really slow is the for loop with << set selected(), apparently this is the only method that I could find for selecting all the items in a list box but it scales terribly with the number of rows.

 

My questions is if there are any best known ways to update the content of the list boxes that is not slow performance wise. I am looking for possible alternatives that would do:

  1. optimal method to set the content of the list box.
  2. fast way to select all the items of the list box.

Any feedback or suggestions would be greatly appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
jthi
Super User

Re: Optimizing list box content update.

Both of these methods feel fairly fast in my opinion

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		H List Box(
			lb1 = List Box(values, nlines(10), width(100)),
			Button Box("reset", reset_lb1),			
		)
	),
	H List Box(
		H List Box(
			lb2_collector = V List Box(
				lb2 = List Box(values, nlines(10), width(100)),
			),
			Button Box("reset2", reset_lb2),			
		)
	)
);
	
reset_lb1 = Expr(
	start1 = HP Time();
	lb1 << Set Items(values);
	end1 = HP Time();
	start2 = end1;
	Nnames = N Items(values);
	For(i = 1, i <= Nnames, i++,
		lb1 << set selected(i);
	);
	end2 = HP Time();
	Show((end1 - start1)/1e6, (end2-start2)/1e6, (end2-start1)/1e6);
);

reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100)));
	For Each({val, idx}, values,
		lb2 << set selected(idx);
	);
	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();
-Jarmo

View solution in original post

5 REPLIES 5
jthi
Super User

Re: Optimizing list box content update.

How many items are you expecting to have in the list box? For 1 there is << Set Items() you can use 

 

Edit:

-Jarmo

Re: Optimizing list box content update.

Hello Jarmo,

 

Thanks for the reply, I will try to use << Set Items() and will check if it is faster then <<remove all(), << append().

 

Regarding the number of items, it is about around ~30k, the strange thing is when I load the script it takes much less to populate the lb from scratch then it takes to update contents, I was thinking as a method to delete the list boxes and then create them again but it might be quite difficult to do all these changes in the scripts.

jthi
Super User

Re: Optimizing list box content update.

Both of these methods feel fairly fast in my opinion

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		H List Box(
			lb1 = List Box(values, nlines(10), width(100)),
			Button Box("reset", reset_lb1),			
		)
	),
	H List Box(
		H List Box(
			lb2_collector = V List Box(
				lb2 = List Box(values, nlines(10), width(100)),
			),
			Button Box("reset2", reset_lb2),			
		)
	)
);
	
reset_lb1 = Expr(
	start1 = HP Time();
	lb1 << Set Items(values);
	end1 = HP Time();
	start2 = end1;
	Nnames = N Items(values);
	For(i = 1, i <= Nnames, i++,
		lb1 << set selected(i);
	);
	end2 = HP Time();
	Show((end1 - start1)/1e6, (end2-start2)/1e6, (end2-start1)/1e6);
);

reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100)));
	For Each({val, idx}, values,
		lb2 << set selected(idx);
	);
	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();
-Jarmo
jthi
Super User

Re: Optimizing list box content update.

One thing to note is that << Set Selected will run script associated with list box (if there is one) by default. If you have script associated with it but don't want it to trigger with each set, use << Set Selected(idx, 1, Run Script(0)) (you can trigger it on last set if you need to)

Names Default To Here(1);

rowcount = 100000;

dt = New Table("Demo",
	Add Rows(rowcount),
	New Column("Values", Character, Nominal, << Set Each Value(
		Hex(Row()) || Hex(Row()) || Hex(Row())
	))
);

values = Column(dt, 1)[dt << get rows where(Excluded(Row State()) != 1)];
Close(dt, no save);

nw = New Window("test",
	H List Box(
		lb2_collector = V List Box(
			lb2 = List Box(values, nlines(10), width(100), Show(1)),
		),
		Button Box("reset2", reset_lb2),			
	)
);
	
reset_lb2 = Expr(
	start3 = HP Time();
	vlb = V List Box(lb2 = List Box(values, nlines(10), width(100), Show(1)));
	For(i = 1, i < N Items(values), i++,
		lb2 << set selected(i, 1, Run Script(0));
	);
	lb2 << set selected(N Items(values), 1, Run Script(1));

	While(!IsEmpty(lb2_collector << child),
		(lb2_collector << child) << delete box;
	);
	lb2_collector << Append(vlb);
	end3 = HP Time();
	Show((end3 - start3)/1e6);
);

Write();

 

-Jarmo

Re: Optimizing list box content update.

Thanks a lot for demonstration. On my machine the second method is around 5x faster, and as you can see most of the time from first method is spent for the set selected loop.