Re: [closure-compiler-discuss] Compiler weakness

29 views
Skip to first unread message

Nick Santos

unread,
Jan 7, 2013, 11:45:52 AM1/7/13
to closure-comp...@googlegroups.com
You're measuring file size incorrectly. See:
http://code.google.com/p/closure-compiler/wiki/FAQ#Closure_Compiler_inlined_all_my_strings,_which_made_my_code_size

2013/1/7 Chenesh <ch...@codeoasis.com>:
> By far, this is a well structured JS compressor, but it still has some
> weaknesses.
> Try typing the following code...
>
> var message = "Lorem ipsum dolor sit amet, consectetur adipiscing elit.
> Praesent sodales, orci id sagittis rhoncus, purus neque ullamcorper neque,
> et scelerisque urna nisl sit amet ipsum. Fusce pharetra aliquet mauris,
> adipiscing pretium augue suscipit ac. Curabitur pretium eleifend enim id
> ultricies. Nam magna mi, ultricies eu dictum vel, semper a augue. Praesent
> eget nunc sem, condimentum venenatis magna. Mauris lobortis vehicula odio,
> nec dapibus nisl eleifend at. Ut eu faucibus ligula.";
>
> alert(message);
> alert(message);
> alert(message);
> alert(message);
> alert(message);
> alert(message);
> alert(message);
>
> and you'll get a -443.58% increase in file size.

Alan Leung

unread,
Jan 7, 2013, 10:17:39 PM1/7/13
to closure-comp...@googlegroups.com
Yep. This is what I saw:

Saved -449.92% off the original size (1.46% off the gzipped size)

As the link suggested, gzipped size is what we should be focusing on.


2013/1/7 Nick Santos <nicks...@google.com>:
Reply all
Reply to author
Forward
0 new messages