You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Entropy <bl...@gmail.com> on 2019/03/08 21:59:17 UTC

Wicket-jquery-ui autocomplete running slow

My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
returning a list that was prefetched and all we do in the getChoices is
create a sublist.  the entire getChoices runs in milliseconds...usually
20-30, which I know because I put a rudimentary timer in it.  Yet, the
autocomplete feels very sluggish as we're testing it.  So I put a timer in a
filter that wraps our wicket calls and timed that.  The filter timer shows
the entire event is running 2-4 seconds.

2-4 seconds per keystroke when the fattest part of the call, the data
retrieval, is only taking 20-30ms seems like something is wrong.  The list's
max size is being limited to 100 rows, but even when I pared it down to 10
rows the improvement was only marginal.

I pasted the code below, but that mostly just shows the getChoices() which,
as I said above, is just filtering over a list in memory.  Any ideas?

		AutoCompleteTextField<String> fld = new
AutoCompleteTextField<String>(fldId)
		{
			protected List<String> getChoices(String input) {
				long start = System.currentTimeMillis();
				if (minInputLen > 0) {
					if (input == null || input.trim().length() < minInputLen) {
						return Collections.EMPTY_LIST;	// empty list
					}
				}
				
				List<String> curMatchingList = getFilterList(valList, input,
maxFilterListSize);	// filters the in memory list valList by the input

				if (curMatchingList == null) {
					curMatchingList = new ArrayList<String>();
				}
				
				if (curMatchingList.size() == 0) {
					if (noResultsVal != null) {
						curMatchingList.add(noResultsVal);	// no-results option
					}
				}
				System.out.println("GETCHOICES: " + (System.currentTimeMillis() -
start));
				return curMatchingList;	// data list
			}
		};

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Martin Grigorov <mg...@apache.org>.
On Mon, Mar 11, 2019 at 1:57 PM Entropy <bl...@gmail.com> wrote:

> The problem is our project is a government one that doesn't let us use
> Maven
> (we've tilted at that windmill multiple times).  So quick starts aren't
> that
> quick for us.
>

We do not ask you to use your project to create the mini project.
Just start from scratch and add the functionality that shows the problem.
Often while doing this the reporter finds the problem him/herself.


>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: Wicket-jquery-ui autocomplete running slow

Posted by Entropy <bl...@gmail.com>.
The problem is our project is a government one that doesn't let us use Maven
(we've tilted at that windmill multiple times).  So quick starts aren't that
quick for us.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Maxim Solodovnik <so...@gmail.com>.
Can you share quick-start project demonstrating this issue?

On Mon, 11 Mar 2019 at 02:44, Entropy <bl...@gmail.com> wrote:
>
> Identical to the timing of getchoices (the method that contains it).  In my
> most recent test 24ms for both while the full request took 6.5 seconds.
>
> --
> Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>


-- 
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Entropy <bl...@gmail.com>.
Identical to the timing of getchoices (the method that contains it).  In my
most recent test 24ms for both while the full request took 6.5 seconds.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Maxim Solodovnik <so...@gmail.com>.
Additional question: What is the timing of `getFilterList` method?

On Sat, 9 Mar 2019 at 08:17, Sebastien <se...@gmail.com> wrote:
>
> Hi, in your browser devtool / network, that the timing says while calling
> getchoice ?
>
> On Sat, Mar 9, 2019, 06:59 Entropy <bl...@gmail.com> wrote:
>
> > My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
> > returning a list that was prefetched and all we do in the getChoices is
> > create a sublist.  the entire getChoices runs in milliseconds...usually
> > 20-30, which I know because I put a rudimentary timer in it.  Yet, the
> > autocomplete feels very sluggish as we're testing it.  So I put a timer in
> > a
> > filter that wraps our wicket calls and timed that.  The filter timer shows
> > the entire event is running 2-4 seconds.
> >
> > 2-4 seconds per keystroke when the fattest part of the call, the data
> > retrieval, is only taking 20-30ms seems like something is wrong.  The
> > list's
> > max size is being limited to 100 rows, but even when I pared it down to 10
> > rows the improvement was only marginal.
> >
> > I pasted the code below, but that mostly just shows the getChoices() which,
> > as I said above, is just filtering over a list in memory.  Any ideas?
> >
> >                 AutoCompleteTextField<String> fld = new
> > AutoCompleteTextField<String>(fldId)
> >                 {
> >                         protected List<String> getChoices(String input) {
> >                                 long start = System.currentTimeMillis();
> >                                 if (minInputLen > 0) {
> >                                         if (input == null ||
> > input.trim().length() < minInputLen) {
> >                                                 return
> > Collections.EMPTY_LIST;  // empty list
> >                                         }
> >                                 }
> >
> >                                 List<String> curMatchingList =
> > getFilterList(valList, input,
> > maxFilterListSize);     // filters the in memory list valList by the input
> >
> >                                 if (curMatchingList == null) {
> >                                         curMatchingList = new
> > ArrayList<String>();
> >                                 }
> >
> >                                 if (curMatchingList.size() == 0) {
> >                                         if (noResultsVal != null) {
> >
> > curMatchingList.add(noResultsVal);      // no-results option
> >                                         }
> >                                 }
> >                                 System.out.println("GETCHOICES: " +
> > (System.currentTimeMillis() -
> > start));
> >                                 return curMatchingList; // data list
> >                         }
> >                 };
> >
> > --
> > Sent from:
> > http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> > For additional commands, e-mail: users-help@wicket.apache.org
> >
> >



-- 
WBR
Maxim aka solomax

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Entropy <bl...@gmail.com>.
The browser's network tab reflects pretty closely the number I see in the
filter.  In my most recent attempt, this was about 6.5 seconds.  Meanwhile
in the same request, the getchoices took 24 milliseconds.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Wicket-jquery-ui autocomplete running slow

Posted by Sebastien <se...@gmail.com>.
Hi, in your browser devtool / network, that the timing says while calling
getchoice ?

On Sat, Mar 9, 2019, 06:59 Entropy <bl...@gmail.com> wrote:

> My project is using the wicket-jquery-ui AutoCompleteTextField.  We're
> returning a list that was prefetched and all we do in the getChoices is
> create a sublist.  the entire getChoices runs in milliseconds...usually
> 20-30, which I know because I put a rudimentary timer in it.  Yet, the
> autocomplete feels very sluggish as we're testing it.  So I put a timer in
> a
> filter that wraps our wicket calls and timed that.  The filter timer shows
> the entire event is running 2-4 seconds.
>
> 2-4 seconds per keystroke when the fattest part of the call, the data
> retrieval, is only taking 20-30ms seems like something is wrong.  The
> list's
> max size is being limited to 100 rows, but even when I pared it down to 10
> rows the improvement was only marginal.
>
> I pasted the code below, but that mostly just shows the getChoices() which,
> as I said above, is just filtering over a list in memory.  Any ideas?
>
>                 AutoCompleteTextField<String> fld = new
> AutoCompleteTextField<String>(fldId)
>                 {
>                         protected List<String> getChoices(String input) {
>                                 long start = System.currentTimeMillis();
>                                 if (minInputLen > 0) {
>                                         if (input == null ||
> input.trim().length() < minInputLen) {
>                                                 return
> Collections.EMPTY_LIST;  // empty list
>                                         }
>                                 }
>
>                                 List<String> curMatchingList =
> getFilterList(valList, input,
> maxFilterListSize);     // filters the in memory list valList by the input
>
>                                 if (curMatchingList == null) {
>                                         curMatchingList = new
> ArrayList<String>();
>                                 }
>
>                                 if (curMatchingList.size() == 0) {
>                                         if (noResultsVal != null) {
>
> curMatchingList.add(noResultsVal);      // no-results option
>                                         }
>                                 }
>                                 System.out.println("GETCHOICES: " +
> (System.currentTimeMillis() -
> start));
>                                 return curMatchingList; // data list
>                         }
>                 };
>
> --
> Sent from:
> http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>