Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

erts: Adjust term_to_binary reduction factors

Made them powers of 2 for faster calculations.

500 encoded terms per reductions seemed a bit much, lowered to 32.

TERM_TO_BINARY_SIZE_FACTOR was not used in practice as it was only
applied to small binaries.

Lowered from 500kb to 256kb compressed bytes per trap call.
  • Loading branch information...
commit 6cff38512b753172a7dfa2bedd60e8987156736d 1 parent 1f09936
@sverker sverker authored
Showing with 3 additions and 5 deletions.
  1. +3 −5 erts/emulator/beam/external.c
View
8 erts/emulator/beam/external.c
@@ -1717,12 +1717,10 @@ erts_term_to_binary(Process* p, Eterm Term, int level, Uint flags) {
/* #define EXTREME_TTB_TRAPPING 1 */
#ifndef EXTREME_TTB_TRAPPING
-#define TERM_TO_BINARY_LOOP_FACTOR 500
-#define TERM_TO_BINARY_SIZE_FACTOR 500000
-#define TERM_TO_BINARY_COMPRESS_CHUNK 500000
+#define TERM_TO_BINARY_LOOP_FACTOR 32
+#define TERM_TO_BINARY_COMPRESS_CHUNK (1 << 18)
#else
#define TERM_TO_BINARY_LOOP_FACTOR 1
-#define TERM_TO_BINARY_SIZE_FACTOR 10
#define TERM_TO_BINARY_COMPRESS_CHUNK 10
#endif
@@ -1859,7 +1857,7 @@ static Eterm erts_term_to_binary_int(Process* p, Eterm Term, int level, Uint fla
/* Finish in one go */
res = erts_term_to_binary_simple(p, Term, size,
level, flags);
- BUMP_REDS(p, size / TERM_TO_BINARY_SIZE_FACTOR);
+ BUMP_REDS(p, 1);
return res;
}
Please sign in to comment.
Something went wrong with that request. Please try again.