From 173d1fd1c3fef385f73accc4b2bbb1b6f92ac3f5 Mon Sep 17 00:00:00 2001 From: Paul Guyot Date: Sun, 4 Jul 2010 15:08:47 +0200 Subject: beam_asm: Simplify string table generation for beams The code for generating the string table (which is now only used for bit syntax matching) in a BEAM file is quite complicated and potentially expensive when compiling modules with many thousands of clauses doing bit syntax matching. Simplify and optimize the code using bit syntax and binary:match/2 instead of the list operations in the original code. --- lib/compiler/test/compilation_SUITE_data/string_table.erl | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 lib/compiler/test/compilation_SUITE_data/string_table.erl (limited to 'lib/compiler/test/compilation_SUITE_data/string_table.erl') diff --git a/lib/compiler/test/compilation_SUITE_data/string_table.erl b/lib/compiler/test/compilation_SUITE_data/string_table.erl new file mode 100644 index 0000000000..1da1d015dd --- /dev/null +++ b/lib/compiler/test/compilation_SUITE_data/string_table.erl @@ -0,0 +1,8 @@ +-module(string_table). +-export([f/1, g/1]). + +f(<<"string">>) -> string; +f(<<"stringtable">>) -> stringtable. + +g(<<"stringtable">>) -> stringtable; +g(<<"table">>) -> table. -- cgit v1.2.3