0

zk 9.6.3- searchbox- with 5000 model objects, zul becoming very slow

asked 2023-03-08 09:59:30 +0800

wastemails gravatar image wastemails
130 1 2

By taking 5000 points (objects not string) , loading zul page very very slow

<searchbox id="points" model="@load(vm.points)" multiple="true" selectedItems="@bind(vm.selectedPoints)" itemConverter="@load(vm.pointConverter)" onSelect="@command('onSelectPoint')" autoclose="true">
            <template name="model">
                <label value="@load(each.name)"/>
            </template>
   </searchbox>
delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2023-03-13 14:52:18 +0800

hawk gravatar image hawk
3250 1 5
http://hawkphoenix.blogsp... ZK Team

I simulate your case with https://zkfiddle.org/sample/3qpi7d9/1-searchbox-with-5000-objects

But it takes 3s to load in my local machine. zkfiddle takes 10s. Could you do a profiling according to https://www.zkoss.org/wiki/ZKDeveloper%27sReference/PerformanceMonitoring/StepbyStepTroubleShooting#JavaProfiling_Tool to locate which part (client or server) is the performance bottleneck?

If you never update each.name dynamically during user interactions, you can use:

<label value="${each.name}"/>

or

<label value="@init(each.name)"/>

That will improve the performance immediately. see http://books.zkoss.org/zk-mvvm-book/9.5/advanced/performance-tips.html

You can remove the itemConverter and test again to see if it's a bottleneck.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2023-03-08 09:59:30 +0800

Seen: 9 times

Last updated: Mar 13 '23

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More