Skip to content

Commit 4bae29b

Browse files
committed
nrf: enable link-time optimization
Testing performed: installed freshly built .uf2 on a Particle Xenon. Checked that circuitpython still starts. Checked that the size of all .uf2 files for nrf builds are plausible. Aside from memory savings, the performance of Python code (pystone) increased by about +14%. However, this adds about 12-16 seconds to each nrf build. Timings & Sizes (build system: i5-3320M, -j5 parallelism on 4 threads): Before: $ make -j5 BOARD=particle_xenon 765004 bytes free in flash out of 1048576 bytes ( 1024.0 kb ). 232076 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ). 68.54user 11.83system 0:34.34elapsed 234%CPU pystones before: 570 After: $ make -j5 BOARD=particle_xenon 804284 bytes free in flash out of 1048576 bytes ( 1024.0 kb ). 232072 bytes free in ram for stack out of 245760 bytes ( 240.0 kb ). 71.06user 11.77system 0:46.91elapsed 176%CPU pystones after: 650 Timings on travis: Before: Build feather_nrf52840_express for pl took 55.79s and succeeded Build feather_nrf52840_express for zh_Latn_pinyin took 3.18s and succeeded After: Build feather_nrf52840_express for pl took 62.72s and succeeded Build feather_nrf52840_express for zh_Latn_pinyin took 19.10s Closes: adafruit#1396
1 parent 28b7cbf commit 4bae29b

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

ports/nrf/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ ifeq ($(DEBUG), 1)
9595
CFLAGS += -fno-inline -fno-ipa-sra
9696
else
9797
CFLAGS += -Os -DNDEBUG
98-
# TODO: Test with -flto
99-
### CFLAGS += -flto
98+
CFLAGS += -flto -flto-partition=none
10099
endif
101100

102101

0 commit comments

Comments
 (0)