Greetings,
I am still relatively new to GWT, although I've been tinkering with it
for about a year now. I've been working on some small network
troubleshooting tools and as part of the process, I'd like to pass
configuration files from server to client (which are then acted upon
by the client side code).
Currently I'm doing this via GWT RPC with an ArrayList<String> (one
per line), but it's seems slow to me. The test file I'm using is about
98k and it's taking almost 4 seconds (according to Firebug's net
analyzer) to get the response once it's submitted.
Thinking that it may be the creation of so many Strings that was
causing the delay, I devised a test passing a single 98k string - but
the time hardly changed at all (it went down by .1 second):
###RPC test implementation###
public String stringTest() {
String filePath = "";
filePath += getServletContext().getRealPath("/");
filePath += "exampleConfig.txt";
String content = "";
try {
FileInputStream fis = new FileInputStream(filePath);
int x = fis.available();
byte b[] = new byte[x];
fis.read(b);
content = new String(b);
} catch (Exception e) {
}
return content;
}
File transfers outside of RPC to this same host (e.g. ftp, scp,
http, ...etc) are magnitudes faster. For example I can wget the same
file in about 70ms.
So I wanted to know:
1. Is this the expected behaviour for RPC? (if so, is it due to
serialization?)
2. Is there something I'm doing wrong or just missing here (being
fairly new to GWT)?
3. Is there another way all together that I could approach this to get
the data to the client faster?
Thanks for any comments!
-Matt
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---