gwtproject / gwt

GWT Open Source Project
http://www.gwtproject.org
1.52k stars 375 forks source link

BigInteger Long deserialisation could be improved #8079

Open dankurka opened 9 years ago

dankurka commented 9 years ago

Originally reported on Google Code with ID 8083

Found in GWT Release (e.g. 2.4.0, 2.5.0 RC):
All

Encountered on OS / Browser (e.g. WinXP, IE8-9, FF7):
WindowsXP, IE8-9, ...

Detailed description (please be as specific as possible):
BigInteger and Long are very expensive to serialize/deserialize.
Big gains could be had for the case where these kind of objects are merely send around
as id's by making the client implementation lazy parse the string representation when
a calculation or real operation is done.

I did that for BigInteger in one of my projects and I saw a huge 10x performance increase.

Shortest code snippet which demonstrates issue (please indicate where
actual result differs from expected result):

Workaround if you have one:
The obvious: don't use Long or BigInteger for representing primary keys, but unfortunately
in large apps that existed even before the GWT tier was implemented making that change
is extremely expensive and involves fixing a lot of legacy code for us.

Links to relevant GWT Developer Forum posts:
https://groups.google.com/forum/?fromgroups=#!topic/google-web-toolkit/I0j7C0TXPMQ

Link to patch posted at http://gwt-code-reviews.appspot.com:

Reported by david.nouls on 2013-03-27 16:08:53

dankurka commented 9 years ago
Do you mind posting a patch to gerrit, see: http://www.gwtproject.org/makinggwtbetter.html

Reported by dankurka@google.com on 2013-05-27 21:00:12

dankurka commented 9 years ago
I am working on it.

Are there specific tests I need to run to check if I did not break anything ?

Is Eclipse setup still supported ? For example it expects me to use a very old version
of checkstyle, which I can no longer install. Or should I use IntelliJ ?

Reported by david.nouls on 2013-05-29 06:49:45

dankurka commented 9 years ago
We'll update the checkstyle dependency in due time (the config files need to be updated
for the new versions), but you can simply run the checkstyle checks from Ant and not
bother enabling checkstyle in Eclipse (that's what I do).

Otherwise, I think the existing tests should be enough, and maybe just make sure they
exercise the "lazy parse" portion of your code? (possibly adding a few new tests if
you feel the need)

Reported by t.broyer on 2013-05-29 13:45:32