File: megaco_performance.html

package info (click to toggle)
erlang-doc-html 1%3A11.b.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 23,284 kB
  • ctags: 10,724
  • sloc: erlang: 505; ansic: 323; makefile: 62; perl: 61; sh: 45
file content (517 lines) | stat: -rw-r--r-- 12,139 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- This document was generated using DocBuilder 3.3.3 -->
<HTML>
<HEAD>
  <TITLE>Performace comparison</TITLE>
  <SCRIPT type="text/javascript" src="../../../../doc/erlresolvelinks.js">
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#FF00FF"
      ALINK="#FF0000">
<CENTER>
<A HREF="http://www.erlang.se"><IMG BORDER=0 ALT="[Ericsson AB]" SRC="min_head.gif"></A>
</CENTER>
<A NAME="8"><!-- Empty --></A>
<H2>8 Performace comparison</H2>
<A NAME="8.1"><!-- Empty --></A>
<H3>8.1 Comparison of encoder/decoders</H3>

<P>The Megaco/H.248 standard defines both a plain text encoding and a 
binary encoding (ASN.1 BER) and we have implemented encoders and 
decoders for both. We do supply a bunch of different encoding/decoding 
modules and the user may in fact implement their own (like our erl_dist 
module). Using a non-standard encoding format has its obvious drawbacks, 
but may be useful in some configurations.
<P>We have made four different measurements of our Erlang/OTP 
implementation of the Megaco/H.248 protocol stack, in order to compare 
our different encoders/decoders. The result of each one is summarized 
in a line chart:<A NAME="8.1.1"><!-- Empty --></A>
<H4>8.1.1 Encoded message size in bytes</H4>

<P>
<CENTER>
<IMG ALT="message_size" SRC="message_size.gif"><BR>
<EM>Encoded message size in bytes</EM>

</CENTER>
<A NAME="8.1.2"><!-- Empty --></A>
<H4>8.1.2 Encode time in micro seconds</H4>

<P>
<CENTER>
<IMG ALT="encode_time" SRC="encode_time.gif"><BR>
<EM>Encode time in micro seconds</EM>

</CENTER>
<A NAME="8.1.3"><!-- Empty --></A>
<H4>8.1.3 Decode time in micro seconds</H4>

<P>
<CENTER>
<IMG ALT="decode_time" SRC="decode_time.gif"><BR>
<EM>Decode time in micro seconds</EM>

</CENTER>
<A NAME="8.1.4"><!-- Empty --></A>
<H4>8.1.4 Sum of encode and decode time in micro seconds</H4>

<P>
<CENTER>
<IMG ALT="total_time" SRC="total_time.gif"><BR>
<EM>Sum of encode and decode time in micro seconds</EM>

</CENTER>
<A NAME="8.2"><!-- Empty --></A>
<H3>8.2 Description of encoders/decoders</H3>

<P>In Appendix A of the Megaco/H.248 specification (RFC 3525), there are 
about 30 messages that shows a representative call flow. We have also 
added a few extra version 1, version2 and version3 messages. 
We have used these messages as basis for our measurements. 
The numbers within parentheses are the plain average values. Our 
figures have not been weighted in regard to how frequent the different 
kinds of messages that are sent between the media gateway and its 
controller.
<P>The test compares the following encoder/decoders:
<P>
<UL>

<LI>
<STRONG>pretty</STRONG> - pretty printed text. In the text encoding, 
         the protocol stack implementors have the choice of using a 
         mix of short and long keywords. It is also possible to add 
         white spaces to improve readability. The pretty text encoding 
         utilizes long keywords and an indentation style like the 
         text examples in the Megaco/H.248 specification.<BR>


</LI>


<LI>
<STRONG>compact</STRONG> - the compact text encoding uses the shortest 
         possible keywords and no optional white spaces.<BR>


</LI>


<LI>
<STRONG>ber</STRONG> - ASN.1 BER.<BR>


</LI>


<LI>
<STRONG>per</STRONG> - ASN.1 PER. Not standardized as a valid 
         Megaco/H.248 encoding, but included for the matter of completeness 
         as its encoding is extremely compact.<BR>


</LI>


<LI>
<STRONG>erl_dist</STRONG> - Erlang's native distribution format. Not 
         standardized as a valid Megaco/H.248 encoding, but included 
         as a reference due to its well known performance characteristics. 
         Erlang is a dynamically typed language and any Erlang data 
         structure may be serialized to the erl_dist format by using 
         predefined built-in functions.<BR>


</LI>


</UL>

<P>The actual encoded messages have been collected in one directory per 
encoding type, containing one file per encoded message.
<P>Here follows an example of a text message to give a feeling of the 
difference between the pretty and compact versions of text messages. 
First the pretty printed, well indented version with long keywords:
<P>

<PRE>
MEGACO/1 [124.124.124.222] 
  Transaction = 9998 { 
    Context = - { 
      ServiceChange = ROOT { 
        Services { 
          Method = Restart, 
          ServiceChangeAddress = 55555, 
          Profile = ResGW/1, 
          Reason = &#34;901 MG Cold Boot&#34;
        }
      }  
    }
  }
</PRE>

<P>Then the compact text version without indentation and with short 
keywords:
<PRE>
!/1 [124.124.124.222] T=9998{
  C=-{SC=ROOT{SV{MT=RS,AD=55555,PF=ResGW/1,RE=&#34;901 MG Cold Boot&#34;}}}}
</PRE>
<A NAME="8.3"><!-- Empty --></A>
<H3>8.3 Setup</H3>

<P>The measurements has been performed on a HP workstation xw6000 
with an Intel Xeon 2.8 GHz, 1 GB memory running Fedora Core 4 (FC4), 
kernel 2.6.14. Software versions was the open source
OTP R10B-10 updated with megaco-3.4.
<A NAME="8.4"><!-- Empty --></A>
<H3>8.4 Complete measurement result</H3>

<P>This chapter details the effects of the possible encoding 
configurations for every codec. The result above are the fastest 
of these configurations for each codec. The figures presented are 
the average of all used messages.
<P>
<CENTER>
<TABLE CELLSPACING=0 CELLPADDING=2 BORDER=1>
  <CAPTION ALIGN=BOTTOM><EM>Codec performance</EM></CAPTION>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
<STRONG>Codec and config</STRONG>
    </TD>
    <TD ALIGN="CENTER" VALIGN="MIDDLE">
<STRONG>Size</STRONG>
    </TD>
    <TD ALIGN="CENTER" VALIGN="MIDDLE">
<STRONG>Encode</STRONG>
    </TD>
    <TD ALIGN="CENTER" VALIGN="MIDDLE">
<STRONG>Decode</STRONG>
    </TD>
    <TD ALIGN="CENTER" VALIGN="MIDDLE">
<STRONG>Total</STRONG>
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
pretty
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
355
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
47
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
197
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
244
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
pretty [flex]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
355
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
47
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
101
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
148
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
compact
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
192
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
42
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
163
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
205
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
compact [flex]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
192
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
42
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
95
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
137
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
per bin
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
96
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
146
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
151
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
297
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
per bin [driver]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
96
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
91
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
143
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
233
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
per bin [native]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
96
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
110
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
116
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
226
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
per bin [driver,native]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
96
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
55
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
108
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
163
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
ber bin
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
174
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
85
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
121
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
206
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
ber bin [driver]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
174
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
85
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
78
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
163
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
ber bin [native]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
174
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
49
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
87
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
136
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
ber bin [driver,native]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
174
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
49
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
44
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
93
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
erl_dist
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
919
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
11
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
14
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
24
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
erl_dist [megaco_compressed]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
364
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
13
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
12
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
26
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
erl_dist [compressed]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
357
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
193
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
46
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
238
    </TD>

  </TR>
  <TR>
    <TD ALIGN="LEFT" VALIGN="MIDDLE">
erl_dist [megaco_compressed,compressed]
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
194
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
162
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
29
    </TD>
    <TD ALIGN="RIGHT" VALIGN="MIDDLE">
191
    </TD>

  </TR>

</TABLE>
</CENTER>
<A NAME="8.5"><!-- Empty --></A>
<H3>8.5 Summary</H3>

<P>In our measurements we have seen that there are no significant 
differences in message sizes between ASN.1 BER and the compact 
text format. Some care should be taken when using the pretty text 
style (which is used in all the examples included in the protocol 
specification and preferred during debugging sessions) since the 
messages can then be quite large. If the message size really is a 
serious issue, our per encoder should be used, as the ASN.1 PER 
format is much more compact than all the other alternatives. Its 
major drawback is that it is has not been approved as a valid 
Megaco/H.248 message encoding.
<P>When it comes to pure encode/decode performance, it turns out that 
our fastest text encoder (compact) is about 14% faster than our 
fastest binary encoder (ber). For decode the fastest binary decoder 
(ber) is 52% better then our fastest text (compact).
Please, observe that these performance figures are related to our 
implementation in Erlang/OTP. Measurements of other implementations 
using other tools and techniques may of course result in other figures. 
If the pure encode/decode performance really is a serious issue, our 
erl_dist encoder should be used, as the encoding/decoding of the 
erlang distribution format is much faster than all the other 
alternatives. Its major drawback is that it is has not been approved 
as a valid Megaco/H.248 message encoding.<CENTER>
<HR>
<SMALL>
Copyright &copy; 1991-2006
<A HREF="http://www.erlang.se">Ericsson AB</A><BR>
</SMALL>
</CENTER>
</BODY>
</HTML>