mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-11 22:28:45 +01:00
Enable link time optimization in the CLI.
One little compiler flag makes a surprisingly large difference: api_call - wren 0.05s 0.0017 130.52% relative to baseline api_foreign_method - wren 0.24s 0.0017 144.54% relative to baseline binary_trees - wren 0.21s 0.0032 112.27% relative to baseline binary_trees_gc - wren 0.75s 0.0288 115.02% relative to baseline delta_blue - wren 0.13s 0.0031 103.24% relative to baseline fib - wren 0.20s 0.0036 120.56% relative to baseline fibers - wren 0.04s 0.0007 108.52% relative to baseline for - wren 0.07s 0.0009 124.45% relative to baseline method_call - wren 0.12s 0.0010 95.58% relative to baseline map_numeric - wren 0.30s 0.0031 110.11% relative to baseline map_string - wren 0.11s 0.0098 111.38% relative to baseline string_equals - wren 0.19s 0.0064 115.49% relative to baseline
This commit is contained in:
@ -36,6 +36,7 @@ TEST_SOURCES := $(wildcard test/api/*.c)
|
||||
|
||||
BUILD_DIR := build
|
||||
|
||||
C_OPTIONS += -flto
|
||||
C_WARNINGS := -Wall -Wextra -Werror -Wno-unused-parameter
|
||||
# Wren uses callbacks heavily, so -Wunused-parameter is too painful to enable.
|
||||
|
||||
@ -142,7 +143,7 @@ bin/$(WREN): $(OPT_OBJECTS) $(CLI_OBJECTS) $(MODULE_OBJECTS) $(VM_OBJECTS) \
|
||||
$(LIBUV)
|
||||
@ printf "%10s %-30s %s\n" $(CC) $@ "$(C_OPTIONS)"
|
||||
@ mkdir -p bin
|
||||
@ $(CC) $(CFLAGS) $^ -o $@ -lm $(LIBUV_LIBS)
|
||||
@ $(CC) $(CFLAGS) -fwhole-program $^ -o $@ -lm $(LIBUV_LIBS)
|
||||
|
||||
# Static library.
|
||||
lib/lib$(WREN).a: $(OPT_OBJECTS) $(VM_OBJECTS)
|
||||
|
||||
Reference in New Issue
Block a user