Robur updates to modulectomy
Changes:
- Added support for ELF binaries compiled on FreeBSD (Clang)
- The way modules are recognized were changed from regexps to using
code_begin/end+data_begin/end+ manually defined symbol-tables - Added an optional interactive scale-SVG that shows how big a part the treemap is of the binary
- Added partitioning operator to
Infofor e.g. filtering too small modules away - UI changes
- Deduplication of symbols that
Oweeproduces - should be fixed on the side ofOweein the future - Support for new
Cmdlinerversion - Fixed that zero-sized modules were rendered, leading to
Nans - Scoping of all CSS, so the SVG + CSS can be included in an existing HTML document
Questions:
- We at Robur didn't need JSOO support, so this was removed - do you think this should be re-added?
- More options for configuration were added via the library interface - how much of this do you think should be available via the
modulectomybinary? (We only usemodulectomyvia its library interface)
Hi ! I apologize, I missed this PR in my emails, even though I was really looking forward to it. :)
I really want to keep the JSOO part (binary size is actually much more important in js-land, and I'm not aware of tools other than modulectomy to investigate bloated jsoo-compiled files). However, I agree that everything should be split a bit more, with different independent-ish libraries. I would also prefer tree-layout not to be vendored.
Regarding the compilation option, I think we can start to integrate everything, and then evaluate which option we want to expose afterward.
I'll take a look at things in more details (in particular, bringing the JSOO part back).
I think we vendored tree_layout because of breaking changes in containers required updating tree_layout, and by vendoring we could quickly get it to a working state. I can take a look at upstreaming the changes to Drup/tree_layout perhaps later this week (unless someone else would like to do it).
On a quick inspection it looks like the only real change we made to tree_layout was to decrease Treemaps._threshold. I'm not sure of the importance of that change...
diff -u src/dune ../modulectomy/tree_layout/dune
--- src/dune 2022-04-05 12:30:07.140817338 +0100
+++ ../modulectomy/tree_layout/dune 2022-04-04 11:58:37.733901914 +0100
@@ -1,7 +1,7 @@
(library
- (name tree_layout)
- (public_name tree_layout)
- (synopsis "Algorithms to layout trees in a pretty manner")
+ (name tree_layout)
+ (public_name modulectomy.tree_layout)
+ (synopsis "Algorithms to layout trees in a pretty manner")
(ocamlopt_flags (:standard -O3))
(libraries iter)
)
diff -u src/treemaps.ml ../modulectomy/tree_layout/treemaps.ml
--- src/treemaps.ml 2022-04-05 12:30:07.140817338 +0100
+++ ../modulectomy/tree_layout/treemaps.ml 2022-02-02 13:02:36.843504495 +0000
@@ -1,6 +1,6 @@
open Common
-let _threshold = 0.00001
+let _threshold = 0.00000001
let _equal_float f1 f2 = abs_float (f1 -. f2) < _threshold
let _equal_pos p1 p2 = _equal_float p1.x p2.x && _equal_float p1.y p2.y
@@ -88,7 +88,7 @@
| [] -> ()
| _ -> begin
let _s = layout ~area sol k in
- (* assert (_s.w *. _s.h >= -. _threshold); *)
+ (*assert (_s.w *. _s.h >= -. _threshold);*)
()
end
Dear @Drup,
I have unvendored tree_layout (our changes didn't make a difference to the output), and I have restored JSOO support in https://github.com/roburio/modulectomy/pull/10. However, it's bound to an older version of js_of_ocaml-compiler.3.5.2.
I spent some time trying to upgrade to a newer version of js_of_ocaml-compiler, but to me it is a bit difficult to follow the changes and find the path to migrating. I was wondering if you would like to take a look at the code as I think you know both jsoo and the js modulectomy code path better.
We would like to build system packages for modulectomy and publish it on opam. In the next release of builder-web we will want modulectomy installed separately.