Re: [ovs-dev] json: Serialize strings using a lookup table

2016-10-05 Thread Ben Pfaff
I just noticed this email.  It sounds beneficial, but no patch was
included.  Do you want to send the patch?

On Wed, Sep 07, 2016 at 08:58:02PM +, Rodriguez Betancourt, Esteban wrote:
> The existing implementation uses a switch with
> many conditions, that when compiled is translated
> to a not optimal series of conditional jumps.
> 
> With a lookup table the generated code has less conditional jumps,
> that should translate in improving the CPU ability to predict the
> jumps.
> 
> Performance Comparison:
> All the timings are in nanoseconds, "OVS Master" corresponds to 13a1d36.
> N is the number of repetitions
> 
> Serialize vswitch.ovsschema
> NOVS Master  Lookup TableDifferenceDiff per op
> 1   233182200369   3281332813
> 10 2724931   1919168  80576380576.3
> 100   22802794  24406648-1603854   -16038.54
> 1000 253645888 2062597604738612847386.128
> 1   23522457031906839780   44540592344540.5923
> 10 23967770920   19012178655  495559226549555.92265
> 
> Serialize echo example
> NOVS Master  Lookup TableDifferenceDiff per op
> 1385712565 -8708-8708
> 10  17403 7312 10091 1009.1
> 100 5785956613  1246   12.46
> 1000   592310   528110 64200   64.2
> 1 6096334  5576109520225   52.0225
> 10   60970439 58477626   2492813   24.92813
> 
> Serialize mutate example
> NOVS Master  Lookup TableDifferenceDiff per op
> 17115  19051 -11936  -11936
> 10  34110  39561  -5451-545.1
> 100296613 298645  -2032-20.32
> 1000  35104992930588 579911579.911
> 133898710   302786313620079362.0079
> 10  305069356  280622992   24446364244.46364
> 
> 
> Signed-off-by: Esteban Rodriguez Betancourt 
> ___
> dev mailing list
> dev@openvswitch.org
> http://openvswitch.org/mailman/listinfo/dev
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev


[ovs-dev] json: Serialize strings using a lookup table

2016-09-07 Thread Rodriguez Betancourt, Esteban
The existing implementation uses a switch with
many conditions, that when compiled is translated
to a not optimal series of conditional jumps.

With a lookup table the generated code has less conditional jumps,
that should translate in improving the CPU ability to predict the
jumps.

Performance Comparison:
All the timings are in nanoseconds, "OVS Master" corresponds to 13a1d36.
N is the number of repetitions

Serialize vswitch.ovsschema
NOVS Master  Lookup TableDifferenceDiff per op
1   233182200369   3281332813
10 2724931   1919168  80576380576.3
100   22802794  24406648-1603854   -16038.54
1000 253645888 2062597604738612847386.128
1   23522457031906839780   44540592344540.5923
10 23967770920   19012178655  495559226549555.92265

Serialize echo example
NOVS Master  Lookup TableDifferenceDiff per op
1385712565 -8708-8708
10  17403 7312 10091 1009.1
100 5785956613  1246   12.46
1000   592310   528110 64200   64.2
1 6096334  5576109520225   52.0225
10   60970439 58477626   2492813   24.92813

Serialize mutate example
NOVS Master  Lookup TableDifferenceDiff per op
17115  19051 -11936  -11936
10  34110  39561  -5451-545.1
100296613 298645  -2032-20.32
1000  35104992930588 579911579.911
133898710   302786313620079362.0079
10  305069356  280622992   24446364244.46364


Signed-off-by: Esteban Rodriguez Betancourt 
___
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev