From da9b3a0825a3243aecfd849e11d1e37e5ccc96af Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 8 Dec 2015 17:41:12 +0100 Subject: erts: inline tag_val_def The tag_val_def function was called and multiple switch statements had to be traversed in term.c, and then a big switch in the calling code to branch on the term types. By inlining the switches are merged by the compiler and a lot fewer branches have to be taken. Benchmarks show that this increases performance of enc_term by as much as 10%. --- erts/emulator/sys/win32/sys.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'erts/emulator/sys/win32') diff --git a/erts/emulator/sys/win32/sys.c b/erts/emulator/sys/win32/sys.c index ea7523ddc2..391bbd4cbc 100644 --- a/erts/emulator/sys/win32/sys.c +++ b/erts/emulator/sys/win32/sys.c @@ -3079,6 +3079,8 @@ erl_bin_write(buf, sz, max) } } +#endif /* DEBUG */ + void erl_assert_error(const char* expr, const char* func, const char* file, int line) { @@ -3094,7 +3096,6 @@ erl_assert_error(const char* expr, const char* func, const char* file, int line) DebugBreak(); } -#endif /* DEBUG */ static void check_supported_os_version(void) -- cgit v1.2.3