简体   繁体   中英

Is it reasonable to have a load on demand datasoruce with thousands of rows and good performance?

Case

I want an interface that lets users search through existing items and provide matches in three columns. but performance is quite essential. So let's say the datasource is a list of people from which I retrieve Name, PhoneNo and Email. I use Telerik's RadComboBox and it's built-in EnableLoadOnDemand (that reloads the list upon keypresses, pastes, etc.).

From a first test, I've seen performance hits appear somewhere around the 500 dataitems mark. To me, this is not unreasonable at all, as the pattern matching is done not only in all three columns, but also is of the type Contains (ie it matches anywhere in a string). By the way, when switching search mode to StartsWith, I don't see any significant performance increases.

RadComboBox

<telerik:RadComboBox runat="server" ID="RadComboBox1" 
                Height="290px" Width="700px" EmptyMessage="Enter your query" EnableVirtualScrolling="False"
                MarkFirstMatch="true" Filter="StartsWith" EnableLoadOnDemand="true"
                HighlightTemplatedItems="true" AutoPostBack="True" EnableTextSelection="true"
                DataSourceID="SqlDataSource1">

                <HeaderTemplate>
                    <ul>
                        <li class="col1">Name</li>
                        <li class="col2">Mobile</li>
                        <li class="col3">E-mail</li>

                    </ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <ul>
                        <li class="col1">
                            <%# DataBinder.Eval(Container.DataItem, "ContactName")%></li>
                        <li class="col2">
                            <%# DataBinder.Eval(Container.DataItem, "Mobile")%></li>
                        <li class="col3">
                            <%# DataBinder.Eval(Container.DataItem, "Email")%></li>


                    </ul>
                </ItemTemplate>

            </telerik:RadComboBox>

Is it reasonable for me to expect to pull this off with, say, 3000 data rows? THat is, are there any ways to optimize my approach?

You can consider creating your own filtering (eg, by storing the data set you get when the handler is first hit, so it takes less time to retrieve data later) and returning a minimal amount of data: http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx . You can also reduce the items per request.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM