Opened 5 years ago

Closed 5 years ago

#12649 closed enhancement (fixed)

Omit symbol tables and debugging from golang binaries

Reported by: dcf Owned by: erinn
Priority: Medium Milestone:
Component: Applications/Tor bundles/installation Version:
Severity: Keywords: TorBrowserTeam201407
Cc: Actual Points:
Parent ID: #12387 Points:
Reviewer: Sponsor:

Description

As discussed in comment:7:ticket:12387, adding -s to the go linker saves plenty of bytes by omitting symbols and debugging.

I checked that this patch runs and bootstraps meek on all the browser platforms.

Child Tickets

Attachments (1)

0001-Use-s-when-linking-golang-programs.patch (3.0 KB) - added by dcf 5 years ago.

Download all attachments as: .zip

Change History (3)

comment:1 Changed 5 years ago by dcf

Status: newneeds_review

Here is the effect on bundle size, comparing both go1.2 versus go1.3 and -s versus not.
I built on top of 5b71d6072028e0d582ad7405597fd615586a0734 with attachment:0001-Use-s-when-linking-golang-programs.patch and attachment:0001-Upgrade-go-to-1.3.patch:ticket:12648.

go1.2 go1.3 go1.2 -s go1.3 -s
linux32 30,480,760
(−0)
30,350,672
(−130,088)
29,761,556
(−719,204)
29,921,656
(−559,104)
linux64 31,974,896
(−0)
31,883,816
(−91,080
31,255,624
(−719,272)
31,411,332
(−563,564)
mac 34,122,441
(−0)
33,925,485
(−196,956)
33,871,833
(−250,608)
33,925,228
(−197,213)
windows 29,524,997
(−0)
29,432,798
(−92,199)
28,650,011
(−874,986)
28,831,524
(−693,473)

Here's the difference in the uncompressed size of the meek-client binary.

go1.2 go1.3 go1.2 -s go1.3 -s
linux32 6,574,768
(−0)
5,105,304
(−1,469,464)
3,188,288
(−3,386,480)
3,578,368
(−2,996,400)
linux64 7,918,328
(−0)
6,332,256
(−1,586,072)
4,027,456
(−3,890,872)
4,539,616
(−3,378,712)
mac 6,502,636
(−0)
5,053,240
(−1,449,396)
5,388,524
(−1,114,112)
5,053,240
(−1,449,396)
windows 6,075,392
(−0)
5,192,192
(−883,200)
3,223,040
(−2,852,352)
3,611,136
(−2,464,256)

go1.2 with -s has the biggest savings. go1.3 with -s doesn't save quite as much, but still better than either version without -s. For whatever reason, -s didn't seem to have an effect on mac with go1.3.

comment:2 Changed 5 years ago by gk

Resolution: fixed
Status: needs_reviewclosed

Thanks, merged in commit a2010553088bdb19b0cdd3b022c882b90c7046b3.

Note: See TracTickets for help on using tickets.