Skip to content

Commit 71f63d0

Browse files
authored
[DO NOT MERGE] Measure cost of function section
I was experimenting with using per function sections instead of a single `.text` section in cg_clif to see if it reduced binary size. It brings the size down for the test I used from 26MB to 15MB like the output of cg_llvm in debug mode. When I measured the linker time the result was a lot less positive: ~0.4s turned into ~0.7s. That is a 75% slowdown. It would be interesting to know what the cost is for cg_llvm over the full rustc-perf benchmark suite.
1 parent c113030 commit 71f63d0

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+1
-1
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ pub fn target_machine_factory(
128128
let (opt_level, _) = to_llvm_opt_settings(optlvl);
129129
let use_softfp = sess.opts.cg.soft_float;
130130

131-
let ffunction_sections = sess.target.target.options.function_sections;
131+
let ffunction_sections = false;
132132
let fdata_sections = ffunction_sections;
133133

134134
let code_model = to_llvm_code_model(sess.code_model());

0 commit comments

Comments
 (0)