Here it is: https://github.com/stephanos/minifyretracer

Stephan

On Tuesday, February 3, 2015 at 10:37:46 PM UTC+1, stephanos wrote:
> Just a quick follow up: I wrote a small Node script to analyse the 
> contribution of each source file that goes into the final artifact. It works 
> by reading the source map and simply counts each character, attributing it to 
> the original source file.
> 
> Here is a sample output:
> 
> source                                             size         %    
> out/app/server/core.cljs                           0.00 KB      0.00 
> out/app.cljs                                       0.00 KB      0.00 
> out/plumbing/core.cljs                             0.01 KB      0.00 
> out/goog/labs/useragent/browser.js                 0.03 KB      0.00 
> out/goog/labs/useragent/engine.js                  0.03 KB      0.00 
> out/goog/history/eventtype.js                      0.03 KB      0.00 
> out/goog/disposable/disposable.js                  0.04 KB      0.01 
> out/goog/dom/browserfeature.js                     0.05 KB      0.01 
> out/goog/history/event.js                          0.05 KB      0.01 
> out/goog/events/eventtype.js                       0.05 KB      0.01 
> out/cljs/nodejs.cljs                               0.06 KB      0.01 
> out/com/cognitect/transit/delimiters.js            0.09 KB      0.01 
> out/app/server/http.cljs                           0.09 KB      0.01 
> out/goog/ui/idgenerator.js                         0.09 KB      0.01 
> out/goog/reflect/reflect.js                        0.09 KB      0.01 
> out/goog/events/listenable.js                      0.09 KB      0.01 
> out/goog/labs/useragent/util.js                    0.10 KB      0.02 
> out/goog/events/browserfeature.js                  0.14 KB      0.02 
> out/goog/events/listener.js                        0.18 KB      0.03 
> out/goog/events/event.js                           0.23 KB      0.04 
> out/com/cognitect/transit/impl/reader.js           0.26 KB      0.04 
> out/cljs/core/async/impl/dispatch.cljs             0.28 KB      0.04 
> out/goog/string/stringbuffer.js                    0.30 KB      0.05 
> out/goog/uri/utils.js                              0.30 KB      0.05 
> out/app/utils/db.cljs                              0.31 KB      0.05 
> out/com/cognitect/transit.js                       0.35 KB      0.06 
> out/app/utils/log.cljs                             0.37 KB      0.06 
> out/clojure/walk.cljs                              0.43 KB      0.07 
> out/cljs/core/async/impl/timers.cljs               0.44 KB      0.07 
> out/app/core.cljs                                  0.44 KB      0.07 
> out/goog/object/object.js                          0.47 KB      0.07 
> out/goog/structs/structs.js                        0.49 KB      0.08 
> out/goog/i18n/timezone.js                          0.51 KB      0.08 
> out/goog/useragent/useragent.js                    0.55 KB      0.09 
> out/shodan/console.cljs                            0.58 KB      0.09 
> out/om/dom.cljs                                    0.67 KB      0.11 
> out/goog/events/listenermap.js                     0.76 KB      0.12 
> out/app/browser/core.cljs                          0.80 KB      0.13 
> out/app/views/pub/terms.cljs                       0.84 KB      0.13 
> out/app/views/pub/about.cljs                       0.84 KB      0.13 
> out/app/views/pub/privacy.cljs                     0.84 KB      0.13 
> out/app/views/pub/contact.cljs                     0.84 KB      0.13 
> out/goog/history/html5history.js                   0.84 KB      0.13 
> out/app/views/pub/sign_in.cljs                     0.85 KB      0.13 
> out/app/views/navbar.cljs                          0.85 KB      0.13 
> out/app/views/pub/imprint.cljs                     0.85 KB      0.13 
> out/app/views/pub/register.cljs                    0.89 KB      0.14 
> out/cljs/core/async/impl/protocols.cljs            0.91 KB      0.14 
> out/com/cognitect/transit/caching.js               0.96 KB      0.15 
> out/goog/array/array.js                            0.96 KB      0.15 
> out/goog/date/utcdatetime.js                       0.97 KB      0.15 
> out/goog/i18n/datetimesymbols.js                   1.00 KB      0.16 
> out/goog/string/stringformat.js                    1.01 KB      0.16 
> out/goog/events/eventtarget.js                     1.04 KB      0.16 
> out/app/browser/history.cljs                       1.05 KB      0.17 
> out/goog/async/nexttick.js                         1.17 KB      0.19 
> out/cljs_time/internal/core.cljs                   1.19 KB      0.19 
> out/app/views/header.cljs                          1.25 KB      0.20 
> out/cljs/core/async/impl/buffers.cljs              1.28 KB      0.20 
> out/goog/string/string.js                          1.29 KB      0.21 
> out/app/views/pub/home.cljs                        1.29 KB      0.21 
> out/com/cognitect/transit/util.js                  1.35 KB      0.21 
> out/com/cognitect/transit/eq.js                    1.37 KB      0.22 
> out/goog/structs/map.js                            1.49 KB      0.24 
> out/clojure/string.cljs                            1.58 KB      0.25 
> out/goog/events/browserevent.js                    1.59 KB      0.25 
> out/sablono/interpreter.cljs                       1.63 KB      0.26 
> out/clojure/set.cljs                               1.69 KB      0.27 
> out/sablono/util.cljs                              1.71 KB      0.27 
> out/cljs/core/async/impl/ioc_helpers.cljs          1.73 KB      0.28 
> out/app/views/root.cljs                            1.74 KB      0.28 
> out/app/views/errors.cljs                          1.78 KB      0.28 
> out/app/views/footer.cljs                          1.91 KB      0.30 
> out/goog/events/events.js                          1.96 KB      0.31 
> out/goog/base.js                                   1.97 KB      0.31 
> out/app/routing.cljs                               2.26 KB      0.36 
> out/app/state.cljs                                 2.57 KB      0.41 
> out/com/cognitect/transit/impl/decoder.js          3.22 KB      0.51 
> out/schema/utils.cljs                              3.32 KB      0.53 
> out/goog/math/long.js                              3.63 KB      0.58 
> out/goog/uri/uri.js                                3.79 KB      0.60 
> out/cljs/core/async/impl/channels.cljs             3.82 KB      0.61 
> out/com/cognitect/transit/handlers.js              4.14 KB      0.66 
> out/com/cognitect/transit/impl/writer.js           4.57 KB      0.73 
> out/datascript/impl/entity.cljs                    4.65 KB      0.74 
> out/cognitect/transit.cljs                         4.95 KB      0.79 
> out/datascript.cljs                                5.70 KB      0.91 
> out/goog/date/date.js                              5.73 KB      0.91 
> out/secretary/core.cljs                            7.06 KB      1.12 
> out/plumbing/fnk/schema.cljs                       7.63 KB      1.21 
> out/cljs_time/format.cljs                          8.15 KB      1.30 
> out/cljs/reader.cljs                               9.33 KB      1.48 
> out/com/cognitect/transit/types.js                 10.04 KB     1.60 
> out/datascript/btset.cljs                          10.35 KB     1.65 
> out/cljs/core/async.cljs                           10.44 KB     1.66 
> out/constants_table.cljs                           14.08 KB     2.24 
> out/datascript/query_parser.cljs                   14.74 KB     2.34 
> out/cljs_time/core.cljs                            15.86 KB     2.52 
> out/datascript/core.cljs                           21.16 KB     3.36 
> out/datascript/query.cljs                          24.03 KB     3.82 
> out/om/core.cljs                                   28.00 KB     4.45 
> out/schema/core.cljs                               31.10 KB     4.95 
> out/cljsjs/development/react.inc.js                125.44 KB    19.94
> out/cljs/core.cljs                                 182.99 KB    29.09
> TOTAL                                              629 KB          
> 
> It's not super accurate, I am maybe missing some details in the 
> implementation - but overall the numbers seem about right. If there is any 
> interest I can clean it up and open source it.
> 
> Note: I suppose some parts of the file can be compressed better than others, 
> so the contributions might have a different share in the gzipped version.
> 
> Stephan
> 
> On Saturday, January 31, 2015 at 5:18:34 PM UTC+1, David Nolen wrote:
> > There's no way to do this as far as I know. The contents of :output-dirĀ 
> > should give a rough estimate.
> > 
> > On Saturday, January 31, 2015, stephanos <stephan...@gmail.com> wrote:
> > Hey there,
> > 
> > 
> > 
> > my current release artifact is 163KB (gzipped+minified) and I was wondering 
> > how the various Google Closure modules contribute to the final size. Since 
> > I use advanced compilation I can't just look at the temporary .js files it 
> > spits out.
> > 
> > 
> > 
> > So, how can I find out each module's size in the optimised artifact?
> > 
> > 
> > 
> > Stephan
> > 
> > 
> > 
> > --
> > 
> > Note that posts from new members are moderated - please be patient with 
> > your first post.
> > 
> > ---
> > 
> > You received this message because you are subscribed to the Google Groups 
> > "ClojureScript" group.
> > 
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to clojurescript+unsubscr...@googlegroups.com.
> > 
> > To post to this group, send email to clojurescript@googlegroups.com.
> > 
> > Visit this group at http://groups.google.com/group/clojurescript.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to