Minified Code

196 views
Skip to first unread message

Matthew Hazlett

unread,
Apr 27, 2012, 12:22:14 AM4/27/12
to nod...@googlegroups.com
Has anyone experimented with minifing code with node?

I know the reason to minify on the client side is its faster load time
to the browser, was just wondering if there were any performance gains
with minimized code on the server side or perhaps a bottleneck with the
eval() of the code.

Mark Hahn

unread,
Apr 27, 2012, 12:48:11 AM4/27/12
to nod...@googlegroups.com
I have always assumed minifying only served the single purpose of speeding up the transfer over the net.  I seriously doubt compile time is improved noticeably.  C++ rips through source quickly.

On Thu, Apr 26, 2012 at 9:22 PM, Matthew Hazlett <haz...@gmail.com> wrote:
Has anyone experimented with minifing code with node?

I know the reason to minify on the client side is its faster load time to the browser, was just wondering if there were any performance gains with minimized code on the server side or perhaps a bottleneck with the eval() of the code.


--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Scott González

unread,
Apr 27, 2012, 7:15:27 AM4/27/12
to nod...@googlegroups.com
For starters, you shouldn't be using a mini goer that results in an eval()...

I suppose there would be a slight performance improvement in disk I/O since there would be fewer bytes to read. But this should all be contained to startup time. It's not going to make your app perform any different.

However, something like Closure Compiler's advanced mode may actually rewrite your app to perform better.


On Friday, April 27, 2012, Matthew Hazlett wrote:
Has anyone experimented with minifing code with node?

I know the reason to minify on the client side is its faster load time to the browser, was just wondering if there were any performance gains with minimized code on the server side or perhaps a bottleneck with the eval() of the code.

--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to

Axel Kittenberger

unread,
Apr 27, 2012, 7:45:35 AM4/27/12
to nod...@googlegroups.com
> I suppose there would be a slight performance improvement in disk I/O since
> there would be fewer bytes to read. But this should all be contained to
> startup time. It's not going to make your app perform any different.

Startup time of Node or V8 is in comparison to other scripting systems
terribly slow (about 30ms on my system vs. e.g. 1ms to below
measurement of time e.g. Lua) so I doubt loading time of the code
determined by size would matter anything compared to that. Not that it
matters anyway, since node is a system that is written and optimized
to be running and not be started often.

Matt

unread,
Apr 27, 2012, 10:23:14 AM4/27/12
to nod...@googlegroups.com
On Fri, Apr 27, 2012 at 7:45 AM, Axel Kittenberger <axk...@gmail.com> wrote:
> I suppose there would be a slight performance improvement in disk I/O since
> there would be fewer bytes to read. But this should all be contained to
> startup time. It's not going to make your app perform any different.

Startup time of Node or V8 is in comparison to other scripting systems
terribly slow (about 30ms on my system vs. e.g. 1ms to below
measurement of time e.g. Lua)

That's comparing it to the fastest scripting language in the world though. How does it compare to something more reasonable like Perl/Python/Ruby? My gut feeling is it compares really well.

Matt.

Jann Horn

unread,
Apr 28, 2012, 5:28:37 AM4/28/12
to nod...@googlegroups.com
Why eval()?

I tried this with node code - 10% startup time improvement. See https://github.com/joyent/node/issues/1538

However, as pointed out there, line numbers will be totally useless.

Azer Koçulu

unread,
Apr 30, 2012, 1:29:07 AM4/30/12
to nod...@googlegroups.com

you guys may be interested at onejs: http://github.com/azer/onejs

Reply all
Reply to author
Forward
0 new messages