aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-07-04 17:10:14 +0200
committerBjörn Gustavsson <[email protected]>2015-07-06 13:38:18 +0200
commitc5755ae5ded3ba27dc5d884303ead232abc77a40 (patch)
tree7bfd4ce8a0c0df8125be7d3864dedf35aac6f6dc
parente820b8534fd440aaf4991f3c57b8990ce836c8b0 (diff)
downloadotp-c5755ae5ded3ba27dc5d884303ead232abc77a40.tar.gz
otp-c5755ae5ded3ba27dc5d884303ead232abc77a40.tar.bz2
otp-c5755ae5ded3ba27dc5d884303ead232abc77a40.zip
Slightly tweak the peformance for get_list
Fetch the head and tail parts to temporary variables before writing them to their destinations. That should allow the CPU to perform the moves in parallel, which might improve performance.
-rw-r--r--erts/emulator/beam/beam_emu.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/erts/emulator/beam/beam_emu.c b/erts/emulator/beam/beam_emu.c
index 989066a1ca..a296713a0a 100644
--- a/erts/emulator/beam/beam_emu.c
+++ b/erts/emulator/beam/beam_emu.c
@@ -662,10 +662,14 @@ void** beam_ops;
SET_I((BeamInstr *) Arg(0)); \
Goto(*I);
-#define GetList(Src, H, T) do { \
- Eterm* tmp_ptr = list_val(Src); \
- H = CAR(tmp_ptr); \
- T = CDR(tmp_ptr); } while (0)
+#define GetList(Src, H, T) \
+ do { \
+ Eterm* tmp_ptr = list_val(Src); \
+ Eterm hd, tl; \
+ hd = CAR(tmp_ptr); \
+ tl = CDR(tmp_ptr); \
+ H = hd; T = tl; \
+ } while (0)
#define GetTupleElement(Src, Element, Dest) \
do { \