adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.24k stars 7.63k forks source link

Minify CodeMirror & other 3rd party libs please? #7718

Open tomByrer opened 10 years ago

tomByrer commented 10 years ago

I noticed you don't minify CodeMirror; is there a reason for that? Hopefully CodeMirror will add a better top-line comment but you can add one if you're worried.

Semi-related: I happen to notice some JavaScript runs faster with just no-whitespace than minified. I'd love to test with CM, but not sure how...

marcelgerber commented 10 years ago

Notice we are still using Chrome 29 in Brackets, where minified files are probably faster than no-whitespace ones.

tomByrer commented 10 years ago

Yes, thanks @SAPlayer I thought this might be the case. Though minification has sped up load times in a previous Brackets build, alot.

TomMalbran commented 10 years ago

Now that CodeMirror is loaded with requireJS, it might be a lot easier to minify it with the rest of the code.

peterflynn commented 10 years ago

@tomByrer We already do minify the vast majority of our source code (2897 KB of our own modules plus 449 KB of thirdparty code), so we'd probably only see a small loading time improvement from this. It's worth doing, but probably low priority.

I'm skeptical that we'd see a significant runtime performance benefit -- I've never seen any solid evidence to support that notion. (The tests linked above seem to confound loading time and runtime performance into the same measurement).

tomByrer commented 10 years ago

We already do minify the vast majority of our source code

Yes, I remember seeing the announcement a while back. I can tell that Brackets load time is much faster; slow loading was one of the things that kept me away; cheers. I understand the low priority.

skeptical that we'd see a significant runtime performance benefit

I'm more curious to find out. I'm surprised there are differences at all. IIRC John-David Dalton tweeted he might make a talk about minification speeding up scripts; I'm sure he'd be a better resource than me. I don't see any current perf tests aside from loading time?

redmunds commented 10 years ago

Interesting that a minified version of codemirror.js is not provided since Marijn hosts UglifyJS which reduces it from 302kb to 126kb.

marcelgerber commented 10 years ago

@redmunds He actually provides a generator: http://codemirror.net/doc/compress.html

lkcampbell commented 10 years ago

@redmunds, I know I already brought this up in Google Group but, if you guys do decide to minify CodeMirror, can we consider keeping a non-minified version in the dev build? I jump into CodeMirror code all of the time when doing Brackets development.

redmunds commented 10 years ago

@lkcampbell Absolutely. It's impossible to debug without an un-minified version.

peterflynn commented 10 years ago

All of our currently minified stuff has source maps, so I assume this wouldn't be any different...