Skip to content

Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).

License

Notifications You must be signed in to change notification settings

Rapougnac/eterl

Repository files navigation

Eterl (External Term Erlang (format))

Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).

Example

import 'package:eterl/eterl.dart';

void main() {
    final data = [{'hello': ['eterl', 1,2,3], 'l': [{'im': 'nested', 'i': {'also': 'supports unicode 💀🗿🥀 èè¨àà¨ü!ääüäöä£üüöäüéèéè>>>><<<<>>~~~'}}]}];
    final packed = eterl.pack(data);
    final unpacked = eterl.unpack(packed);
    print(unpacked);
}

Supported terms

  • Strings
  • Atoms (only while decoding)
  • bools
  • doubles
  • ints
  • BigInts
  • Maps
  • Lists
  • Tuples (only while decoding, tuples are converted into a List)

Benchmarks

dart run benchmark/eterl_benchmark.dart

[210ms:142us] Encoder: hello world
  mean: 0.15 ± 0.11 us, median: 0.13 ± 0.017 us
  ▉▂▄▂__________  110  _____ sample size: 100 (averaged over 225 runs)

[243ms:186us] Encoder: data
  mean: 2.59 ± 0.76 us, median: 2.28 ± 0.24 us
  ▆▉▄▂________________▁_______ sample size: 79 (averaged over 199 runs)

[274ms:047us] Encoder: Complex data
  mean: 49.75 ± 12.45 us, median: 42.58 ± 14.93 us
  ▉▁▁▁_ sample size: 28 (averaged over 46 runs)

[206ms:551us] Decoder: hello world
  mean: 0.23 ± 0.12 us, median: 0.17 ± 0.10 us
  ▉_▄▁_____________ sample size: 100 (averaged over 188 runs)

[243ms:790us] Decoder: data
  mean: 3.60 ± 1.17 us, median: 2.91 ± 1.46 us
  ▉▆▁▁▃_ sample size: 75 (averaged over 165 runs)

[266ms:378us] Decoder: Complex data
  mean: 158.66 ± 312.078 us, median: 63.87 ± 12.28 us
  ▉▅▁_▁____  149  _____ sample size: 27 (averaged over 28 runs)

About

Eterl is a fast packer and unpacker for the External Term Erlang Format (version 131).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages