| Issue 599: | PATCH to reduce size of generated JavaScript | |
| 4 people starred this issue and may be notified of changes. | Back to list |
Sign in to add a comment
|
GWT Release:
1.3.1
Detailed description:
GWT's Java to JavaScript compiler currently places a space around every
binary operator (=,+,-,==, etc), for the most part this isn't needed to
distinguish operators from variables or expressions ("instanceof" and "in"
are the exceptions). The one place I can think of where this may cause a
problem is with unary operators (--,++,!,-) adjacent to binary operators
because then it's not clear what some character sequences mean (in
"foo---bar" is foo decremented or is bar?). To address this I added spaces
before or after unary operators to prevent that confusion.
While not the optimal solution, this patch saves bytes because binary
operators are more common than unary operators and even if they weren't
unary operators only need one space to be unambiguous while binary
operators currently use two spaces.
In my testing this patch saves almost 6% on the cache.html files sizes.
Links to the relevant GWT Developer Forum posts:
http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_frm/thread/0a78989904807771/2aac13704f6e8d79?#2aac13704f6e8d79
|
||||||||||||||
,
Jan 16, 2007
Thanks, Sandy!
Status: Accepted
Owner: gwt.team.scottb Labels: -Type-Defect -Priority-Medium Type-Enhancement Priority-High Milestone-1_4_RC |
|||||||||||||||
,
Feb 02, 2007
This is great, I'm seeing the same reduction in size across the board.
Status: Started
|
|||||||||||||||
,
Feb 05, 2007
Submitted as r356.
Status: FixedNotReleased
|
|||||||||||||||
,
May 23, 2007
(No comment was entered for this change.)
Labels: Category-Compiler
|
|||||||||||||||
,
May 29, 2007
Changing to Fixed status with GWT 1.4 RC release
Status: Fixed
|
|||||||||||||||
|
,
Apr 28, 2008
Owner: scottb
|
|||||||||||||||
|
|
|||||||||||||||