REALbasic Tip: Speed up controls line

If you are not satisfied with the time of add or load data into some controls there is a nice way to speed it up to 5-7 times. For example when you add 1 000 000 rows to Listbox control you must wait over 10 seconds to finish. We can make this in 2-3 seconds…

Speed up solution

The solution for increasing the speed of some actions made in REALbasic controls is practically easy. We will use our Listbox Control example. REALbasic redraws the Listbox each time we AddRow to our control. To make it 5-7 times faster we must hide it for the time of using loop for i = 1 to 1000000. And this works!

1
2
3
4
5
6
7
8
Dim i As Integer
 
Listbox1.Visible = false
 
for i = 1 to 1000000
    Listbox1.AddRow Str(i)
next
    Listbox1.Visible = true

Author: Jakub Pawlak

I'm interested in all. Currently working on the development of TUTSPOLIS and I hope that in near feature the project will be successful.

8 Responses to “REALbasic Tip: Speed up controls”

  1. Steve says:

    Excellent tip! AND an Excellent Site.
    It has renewed my interest in RB.

  2. Jakub Pawlak says:

    Nice to hear that Stave :)

  3. Scott says:

    Great tip. I just started following your site since I found you via Twitter. Keep up the great work!!

  4. Jakub Pawlak says:

    Thank you Scott for good word!

  5. Andrew says:

    Fantastic tip. I had never thought to do this.

    Thanks!

  6. Jakub Pawlak says:

    You welcome Andrew :)

  7. Arjun says:

    Excellent tip Jakub! Keep rocking!

  8. Wes says:

    Thanks for the great tip! I’m trying to get around the listbox not being transparent by drawing the appropriate portion of the window background into each cell. It was taking a bit to load and slamming the CPU.

    This trick makes it load instantly and CPU usage dropped by 90%!

Leave a Reply

Copyrights (c) TUTSPOLIS | Powered by Wordpress MU | Inspired at Elegant Themes designed by qbap (HTML5 & CSS3)