SQLITE Slow !!!

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • roti
    Forum Member
    • Mar 2005
    • 27

    SQLITE Slow !!!

    hi everyone

    i have just used Customer application with sqlite
    when i load large DB File it takes long time to view
    how could i reduce the time of viewing ?

    Thanks in advance
  • bule
    Indigo Rose Customer
    • May 2005
    • 1116

    #2
    It is not a SQLite problem. It is a performance issue with ListBox/ComboBox in AutoPlay Media Studio when filled with more than 1000 entires. You might gain some performance with ListBox.SetUpdate(false) before updating, but not much...

    Try using DataGrid instead... it is much faster, all through there is no OnFocus and OnKey functionality with DataGrid.
    Last edited by bule; 01-18-2007, 08:55 AM.
    Never know what life is gonna throw at you. ZubTech

    Comment

    • bule
      Indigo Rose Customer
      • May 2005
      • 1116

      #3
      Can you show us the code you are using to populate data on screen?
      Never know what life is gonna throw at you. ZubTech

      Comment

      • azmanar
        Indigo Rose Customer
        • Oct 2004
        • 1020

        #4
        Hi,

        I think ...Listbox Actions should come with Callback Function. At least a Progress Bar can be shown during List.Add or List.Insert
        Newbie Examples
        ------> AMS 7.5 : amstudio.azman.info
        ----> AMS 6 & 5: www.azman.info/ams/
        ----> FB: facebook.com/GuideToWealth

        ----> Content Development Blog: www.AZMAN.asia

        Comment

        • bule
          Indigo Rose Customer
          • May 2005
          • 1116

          #5
          Indeed... but that will render the process even slower. :(
          Never know what life is gonna throw at you. ZubTech

          Comment

          • Worm
            Indigo Rose Customer
            • Jul 2002
            • 3967

            #6
            I just posted an example to the examples forum that will fill a listbox much quicker. As soon as IR approves it, it should show up.

            Here's the code behind it.
            Code:
            function ListBoxAddItem(oListBox, sItem)
            	DLL.CallFunction(_SystemFolder.."\\User32.dll", "SendMessageA", ListBox.GetProperties(oListBox).WindowHandle..",384,0,\""..sItem.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
            end
            
            for n=1, 5000 do
            	ListBoxAddItem("ListBox1", "Item"..n)
            end
            Last edited by Worm; 01-18-2007, 12:47 PM.

            Comment

            • azmanar
              Indigo Rose Customer
              • Oct 2004
              • 1020

              #7
              Thanks Worm...
              Newbie Examples
              ------> AMS 7.5 : amstudio.azman.info
              ----> AMS 6 & 5: www.azman.info/ams/
              ----> FB: facebook.com/GuideToWealth

              ----> Content Development Blog: www.AZMAN.asia

              Comment

              • Worm
                Indigo Rose Customer
                • Jul 2002
                • 3967

                #8
                Same deal for Combo too

                Code:
                function ComboAddItem(oCombo, sItem)
                	DLL.CallFunction(_SystemFolder.."\\User32.dll", "SendMessageA", ComboBox.GetProperties(oCombo).WindowHandle..",323,0,\""..sItem.."\"", DLL_RETURN_TYPE_LONG, DLL_CALL_STDCALL)
                end
                
                for n=1, 5000 do
                	ComboAddItem("ComboBox1", "Item"..n)
                end

                Comment

                • Worm
                  Indigo Rose Customer
                  • Jul 2002
                  • 3967

                  #9
                  Use Desmond's method in this thread



                  Much better, and it actually works, unlike mine :o

                  Comment

                  • bule
                    Indigo Rose Customer
                    • May 2005
                    • 1116

                    #10
                    Worm, you are passing Name, but not Data as well...

                    With this Desmond's method.. while still faster, try adding 30000 items;
                    It will not take 6 times much time (5000×6), but somewhere arount 22 times...
                    Last edited by bule; 01-18-2007, 01:25 PM.
                    Never know what life is gonna throw at you. ZubTech

                    Comment

                    • Worm
                      Indigo Rose Customer
                      • Jul 2002
                      • 3967

                      #11
                      The data field is a tricky one as the listbox itself will only hold a LONG for data. IR is doing us a favor by making it so we can use strings or numerics. I could set the data, but it would have to be numeric with this method. One work around would be to use an invisible Listbox with the data items. But, all of this is a mute point as the items once added, can't be selected. They show in the listbox alright, but...

                      Sorry, thought I'd stumbled onto something.

                      Comment

                      • azmanar
                        Indigo Rose Customer
                        • Oct 2004
                        • 1020

                        #12
                        Hi,

                        In Desmond's method, it does add some speed with the loop.

                        But by using ListBox.update, the latest added info in the LB containing hundreds of items will be buried deep down. Therefore will not get selected.
                        Newbie Examples
                        ------> AMS 7.5 : amstudio.azman.info
                        ----> AMS 6 & 5: www.azman.info/ams/
                        ----> FB: facebook.com/GuideToWealth

                        ----> Content Development Blog: www.AZMAN.asia

                        Comment

                        • roti
                          Forum Member
                          • Mar 2005
                          • 27

                          #13
                          Originally posted by bule View Post
                          It is not a SQLite problem. It is a performance issue with ListBox/ComboBox in AutoPlay Media Studio when filled with more than 1000 entires. You might gain some performance with ListBox.SetUpdate(false) before updating, but not much...

                          Try using DataGrid instead... it is much faster, all through there is no OnFocus and OnKey functionality with DataGrid.
                          where can i get DataGrid

                          Comment

                          • roti
                            Forum Member
                            • Mar 2005
                            • 27

                            #14
                            Thanks bule , Azmanar , Worm
                            the Problem is with generating the HTML report
                            it takes a very long time to generate the report

                            Comment

                            • bule
                              Indigo Rose Customer
                              • May 2005
                              • 1116

                              #15
                              How do you generate it? (what method)
                              Never know what life is gonna throw at you. ZubTech

                              Comment

                              Working...
                              X