Is dead code elimination really working?
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- clojure
- Lĩnh vực
- build-system
Hướng nghiên cứu
Bắt đầu với cấu hình build trong profile.cljs và namespace cùng điểm vào dev-setup trong core.cljs, sử dụng template reagent-figwheel và các thiết lập advanced-optimization được liệt kê. Tái hiện năm build và so sánh kích thước đầu ra của chúng; hoàn thành có nghĩa là giải thích liệu dependency devtools không được sử dụng có bị loại bỏ hay không, đồng thời ghi lại hoặc sửa kết quả quan sát được.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I can't seem to bring the code size down with a barely empty project through dead-code elimination alone, even when following the installation instructions to the letter.
The template used was reagent-figwheel with only devtools and reagent as dependencies. I've fiddled with the goog.DEBUG flag, and then removed devtools from the :require and :dependencies vectors.
| Type | Size |
|---|---|
:dependencies + :require + goog.DEBUG true |
1.9 MB |
:dependencies + :require + goog.DEBUG false |
1.5 MB |
:dependencies + :require + no mention at all |
1.6 MB |
:dependencies + no :require + no mention at all |
763 KB |
no :dependencies + no :require + no mention at all |
763 KB |
The first two rows followed the instructions from the release notes. There's a single mention of (devtools/install!) within a (when ^boolean js/goog.DEBUG ...) block. The other three had this line removed manually.
Google Closure's shaved 400kb of the build, but that's still a 800kb increase for a :require without a single mention of devtools! Is this the best I can expect from dead code elimination?
Here's the code used for the builds (e.g. lein new reagent-figwheel +devtools):
;##################
;### profile.cljs
(defproject devtools-dce "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/clojurescript "1.9.229"]
[reagent "0.6.0"]
[binaryage/devtools "0.8.2"]]
[...]
:cljsbuild
{:builds
[{:id "min"
:source-paths ["src/cljs"]
:compiler {:main devtools-dce.core
:optimizations :advanced
:output-to "resources/public/js/compiled/app.js"
:output-dir "resources/public/js/compiled/min"
:closure-defines {goog.DEBUG false}
:pseudo-names true ;; added to exacerbate size difference
:pretty-print false}}
]})
;##############
;## core.cljs
(ns devtools-dce.core
(:require
[reagent.core :as reagent]
[devtools.core :as devtools]
))
[...]
(defn dev-setup [] ;; inlining into `main` made no difference
(when ^boolean js/goog.DEBUG
(enable-console-print!)
(println "dev mode")
(devtools/install!)
))
(defn ^:export main []
(dev-setup)
(reload))
- Ngôn ngữ chính
- Clojure
- Star
- 1.1k
- Fork
- 51
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của binaryage/cljs-devtools
-
ROOK Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 5/100
binaryage/cljs-devtools#82 · 1 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
binaryage/cljs-devtools#81 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
binaryage/cljs-devtools#80 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
binaryage/cljs-devtools#79 ·
-
Add steps for shadow-cljs build Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
binaryage/cljs-devtools#76 · 1 bình luận ·
Tất cả issue của binaryage/cljs-devtools
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
clojure-emacs/cider#4203 ·
-
.Team/QueryingPlatform Priority:P2
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
clj-commons/antq#329 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100