在GWT中将大型数组从服务器传输到客户端 [英] Transferring large arrays from server to client in GWT

查看:96
本文介绍了在GWT中将大型数组从服务器传输到客户端的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Asynchronous RPC调用从我的服务器向客户端传输一个大的二维数组(17955 X 3)。这需要很长时间,这是非常糟糕的,因为需要数据来初始化应用程序。我读过使用JSON对象可能会更快,但我不确定如何在Java中进行转换,因为我对语言和GWT非常陌生,并且我不知道速度差异是否显着。我还在某处读到可以压缩数据的地方,但我只是在论坛上阅读,我不确定它是否可行,因为我无法在其他地方找到相关信息。有没有办法将大量数据从服务器传输到客户端?感谢您的时间。

正如其他人指出的那样,应该重新考虑您的设计,因为即使您能够以某种方式解决数据传输速度问题,您也可能会发现其他问题等待您:


  1. 处理大量数据在浏览器中可以很慢。

  2. 大量数据意味着大量用完的内存

您可以考虑什么是:

对数据进行分区:

您的用户如何应对有很多数据。您的用户可能需要某种用户界面帮助才能处理如此庞大的数据。如果您打算使用分页,制表符或其他方式对数据进行分区以供用户使用,为何不按需加载数据。例如,如果您正在使用分页网格,则可以加载单页记录,或者如果您要使用选项卡,则可以加载单个记录值的记录。相似地,如果您打算允许对记录进行过滤,则可以在加载之后设置默认过滤器以将数据保持最小值。



总结数据:

如果您不打算向用户显示每行,您还可以汇总服务器上的数据。例如,您最初可以为每组记录显示摘要,并让用户在特定的组中进行深入分析。


I'm attempting to transfer a large two dimensional array (17955 X 3) from my server to the client using Asynchronous RPC calls. This is taking a very long period of time which is especially bad because the data is needed in order to initialize the application. I've read that using a JSON object might be faster, but I'm not sure how to do the conversion in Java as I'm pretty new to the language and GWT, and I don't know if the speed difference is significant. I also read somewhere that I can zip the data, but I only read that in a forum and I'm not sure if it's actually possible as I couldn't find information for it elsewhere. Is there any way to transfer large amounts of data from server to client? Thanks for your time.

解决方案

As other's pointed out, you should re-consider your design because even if you are able to solve the data transfer speed issue somehow you will likely find other issues waiting for you:

  1. Processing large amount of data in the browser can be slow.
  2. Lot of data means a lot of used-up memory

What you can think about is:

Partitioning the data:

How is your user going to cope with a lot of data. Your user will probably need some kind of user interface aid to be able to work with such a huge data. If you are going to use paging, tabs or other means to partition the data for user's consumption, why not load the data on demand. For example, you can load a single page of records if you are using a paging grid or you can load a single tab worth of records if you are going to use tabs. Similary, if you are going to allow filtering on the records, you can set a default filter after the load to keep the data to a minumum.

Summarizing the data:

You can also summarize the data on the server, if you are not going to show each row to the user. For example you can initially show summary for each group of records and let the user drill-down in a specific group

这篇关于在GWT中将大型数组从服务器传输到客户端的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆