GWT RequestFactory性能 [英] GWT RequestFactory Performance
问题描述
我有一个关于RequestFactory和GWT性能的问题。我有一个带有8个字段的域实体,返回大约1000个EntityProxies。请求触发和响应之间的时间约为20秒。我这样做,但返回10个EntityProxies和时间是17秒,几乎相同。
这是因为我在开发模式,或者当我释放代码到网络的时间将是相同的?
有什么方法可以提高性能? ,我只是读数据,所以也许只有读和不写的东西可能是解决方案?
我读了这篇文章,类似于我的问题:
非常感谢。
PD:我在某处读到一种解决方案可能是在服务器中创建一个xml,发送给客户端并在那里重新创建对象,我不想这样做,因为它会真的改变我的应用程序的设计。
感谢大家的帮助,我现在意识到可能使用Request Factory来检索数千条记录是一个错误。我根据这篇文章最初使用定位器来覆盖isLive()和Find()方法:
gwt-requestfactory-performance-suggestions
响应时间减少到13秒左右,但仍然过高。
但我很容易解决它。我创建了一个新的数据库表,其中每个字段都具有由分隔符连接的所有相同字段记录(1000+)(每个数据库字段的长度约为10000),并且表中只有一条记录大约8个领域。
类似这样:
Field1 | Field2 | Field3
Field1val; Field1val; Field1val; ....... | Field2val; Field2val; Field2val; ...... | Field3val; Field3val; Field3val; ......
我通过RequestFactory将一条记录返回给我的客户端,它大大降低了速度!我在客户端解析这个大的字符串,其持续时间约为500毫秒。所以,不要浪费大约20秒钟,现在大约需要1-2秒钟。
顺便说一句,我只显示信息,没有必要插入,删除或更新记录,所以这个解决方案适用于我。
以为我可以分享这个解决方案。
I have a question regarding the performance of RequestFactory and GWT. I have a Domain Entity with 8 fields that returns around 1000 EntityProxies. The time between the request fires and it responds is around 20 seconds. I do the same but returning 10 EntityProxies and the time is 17 seconds, almost the same.
Is this because I'm working in development mode, or when I release the code to the web the time will be the same?
Is there any way to improve the performance? , I'm only reading data so perhaps something that only read and doesn't writes may be the solution?
I read this post with something similar to my problem:
GWT Requestfactory performance suggestions
Thanks a lot.
PD: I read somewhere that one solution could be to create an xml in the server, send it to the client and recreate the object there, I don't want to do this because it would really change the design of my app.
Thank you all for the help, I realize now that perhaps using Request Factory to retrieve thousands of records was a mistake.
I initially used a Locator to override isLive() and Find() methods according to this post: gwt-requestfactory-performance-suggestions
The response time was reduced to about 13 seconds, but it is still too high.
But I solved it easily. Instead of returning 1000+ Entities , I created a new database table which each field has all the same field records (1000+) concatenated by a separator (each db field has a length of about 10000 ) and I only have one record in the table with around 8 fields.
Something like this:
Field1 | Field2 | Field3
Field1val;Field1val;Field1val;....... | Field2val;Field2val;Field2val;...... | Field3val;Field3val;Field3val;......
I return that One record through RequestFactory to my client and it reduced the speed a lot!, around 1 second. I parse this large String in the client and the duration of that is about 500ms. So instead of wasting around 20 seconds now it takes around 1-2 seconds to accomplish the same.
By the way I am only displaying information, it is not necessary to Insert, Delete or Update records so this solution works for me.
Thought I could share this solution.
这篇关于GWT RequestFactory性能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!