I ran some small tests. I'm attaching the test script (perf_test), as
well as the test results from main (main_stats.txt) and from the lflow
refactor (lflow_refactor_stats.txt).

In summary, the test does the following:
* Create 1000 logical switches.
* Create 1000 logical routers, and link one logical switch to one
logical router.
* Perform an ovn-nbctl --wait=sb sync.

For each of the operations listed above, we:
* Time the operation.
* Check the stopwatch stats for the "build_lflows" and "ovnnb_db_run"
stopwatches. These are the stopwatches that run during a recompute of
en_lflow and en_northd. This gives us an idea of how many recomputes
we saw during the operation, and shows us stats for code areas that
are affected by this patch series.
* Clear stopwatch and incremental engine stats.
* Run a recompute.
* Check the stopwatch stats for "build_lflows" and "ovnnb_db_run"
stopwatches again. This tells us how long a recompute takes once the
network is fully built.

The result is that main and the lflow refactor perform nearly
identically. This is not too surprising since there aren't any
algorithmic changes introduced in this refactor. The changes mostly
center around the data types being used by the lflow library in OVN.

If you have concerns about specific operations or code sections that
are not reflected in this particular test, please let me know and I'll
check those as well.

On Mon, Jan 12, 2026 at 9:18 AM Mark Michelson <[email protected]> wrote:
>
> Hi Ilya, I can run some (unscientific) benchmarks using the OVN
> sandbox and report back what I see.
>
> On Mon, Jan 12, 2026 at 4:50 AM Ilya Maximets <[email protected]> wrote:
> >
> > On 1/9/26 6:54 PM, Mark Michelson via dev wrote:
> > > This series refactors the logical flow library with two goals in mind:
> > >
> > > 1) Eliminate the use of any structures that are created by the en-northd
> > > incremental engine node. Composable services will define new datapath
> > > types that will bypass en-northd processing. This allows for them to
> > > add, remove and sync logical flows without the need for structures like
> > > ovn_datapath or ovn_datapaths.
> > >
> > > 2) Eliminate the dichotomy that every logical datapath must either be a
> > > switch or a router. New datapath types may be added, and when they are
> > > added, the lflow library needs to accommodate those new types without
> > > having to be altered.
> > >
> > > Mark Michelson (9):
> > >   Add sparse array.
> > >   northd: Convert ovn_datapath to use sparse_array.
> > >   Use a sparse array for synced datapaths.
> > >   northd: Base ovn_datapath index on synced_datapath index.
> > >   lflow-mgr: Use a dynamic bitmap when updating SB DP groups.
> > >   datapath-sync: Make ovn_synced_datapath_from_sb() public.
> > >   lflow-mgr: Use an array for lflow dp groups.
> > >   lflow-mgr: Don't use ovn_datapath when adding logical flows.
> > >   lflow-mgr: Remove ovn_datapaths from functions.
> > >
> > >  lib/automake.mk                  |   2 +
> > >  lib/ovn-util.h                   |  15 +++
> > >  lib/sparse-array.c               | 102 +++++++++++++++
> > >  lib/sparse-array.h               |  54 ++++++++
> > >  northd/datapath-sync.c           |  27 ++++
> > >  northd/datapath-sync.h           |   8 ++
> > >  northd/en-datapath-sync.c        |  62 ++++-----
> > >  northd/en-lflow.c                |  22 ++--
> > >  northd/en-lr-nat.c               |   2 +-
> > >  northd/en-lr-stateful.c          |   2 +-
> > >  northd/en-ls-arp.c               |   2 +-
> > >  northd/en-ls-stateful.c          |   2 +-
> > >  northd/en-sync-sb.c              |  57 ++++----
> > >  northd/inc-proc-northd.c         |   7 +
> > >  northd/lb.c                      |   4 +-
> > >  northd/lflow-mgr.c               | 214 ++++++++++++++-----------------
> > >  northd/lflow-mgr.h               |  52 ++++----
> > >  northd/northd.c                  | 115 ++++++-----------
> > >  northd/northd.h                  |  15 +--
> > >  tests/automake.mk                |   1 +
> > >  tests/ovn-inc-proc-graph-dump.at |   2 +
> > >  tests/ovn.at                     |   5 +
> > >  tests/test-sparse-array.c        | 206 +++++++++++++++++++++++++++++
> > >  23 files changed, 662 insertions(+), 316 deletions(-)
> > >  create mode 100644 lib/sparse-array.c
> > >  create mode 100644 lib/sparse-array.h
> > >  create mode 100644 tests/test-sparse-array.c
> > >
> >
> > Hi, Mark, Ales.  This code is touching a lot of performance-critical parts
> > in northd.  Do we have some performance numbers for it?  ovn-heater is
> > currently broken, unfortunately, but at least some manual test results with
> > a large database to see recompute times would be good to have.
> >
> > Best regards, Ilya Maximets.
> >
Output from main
Adding 1000 logical switches

real    0m8.872s
user    0m4.627s
sys     0m2.603s

Stopwatch stats after adding switches
Statistics for 'build_lflows'
  Total samples: 962
  Maximum: 13 msec
  Minimum: 0 msec
  95th percentile: 11.003621 msec
  Short term average: 10.998827 msec
  Long term average: 10.133696 msec
Statistics for 'ovnnb_db_run'
  Total samples: 0
  Maximum: 0 msec
  Minimum: 0 msec
  95th percentile: 0.000000 msec
  Short term average: 0.000000 msec
  Long term average: 0.000000 msec

Stopwatches after a recompute
Statistics for 'build_lflows'
  Total samples: 1
  Maximum: 11 msec
  Minimum: 11 msec
  95th percentile: 0.000000 msec
  Short term average: 11.000000 msec
  Long term average: 11.000000 msec
Statistics for 'ovnnb_db_run'
  Total samples: 1
  Maximum: 4 msec
  Minimum: 4 msec
  95th percentile: 0.000000 msec
  Short term average: 4.000000 msec
  Long term average: 4.000000 msec

Adding 1000 logical routers and linking them to switches

real    0m59.550s
user    0m28.867s
sys     0m11.036s

Stopwatch stats after adding routers
Statistics for 'build_lflows'
  Total samples: 937
  Maximum: 85 msec
  Minimum: 10 msec
  95th percentile: 70.050553 msec
  Short term average: 70.257797 msec
  Long term average: 63.226259 msec
Statistics for 'ovnnb_db_run'
  Total samples: 829
  Maximum: 26 msec
  Minimum: 2 msec
  95th percentile: 22.120883 msec
  Short term average: 22.158947 msec
  Long term average: 19.342639 msec

Stopwatches after a recompute
Statistics for 'build_lflows'
  Total samples: 1
  Maximum: 69 msec
  Minimum: 69 msec
  95th percentile: 0.000000 msec
  Short term average: 69.000000 msec
  Long term average: 69.000000 msec
Statistics for 'ovnnb_db_run'
  Total samples: 1
  Maximum: 27 msec
  Minimum: 27 msec
  95th percentile: 0.000000 msec
  Short term average: 27.000000 msec
  Long term average: 27.000000 msec

Timing an nbctl sync

real    0m0.007s
user    0m0.004s
sys     0m0.002s

Output from lflow refactor:
Adding 1000 logical switches

real    0m8.739s
user    0m4.623s
sys     0m2.521s

Stopwatch stats after adding switches
Statistics for 'build_lflows'
  Total samples: 946
  Maximum: 13 msec
  Minimum: 0 msec
  95th percentile: 11.732714 msec
  Short term average: 12.472508 msec
  Long term average: 10.817394 msec
Statistics for 'ovnnb_db_run'
  Total samples: 0
  Maximum: 0 msec
  Minimum: 0 msec
  95th percentile: 0.000000 msec
  Short term average: 0.000000 msec
  Long term average: 0.000000 msec

Stopwatches after a recompute
Statistics for 'build_lflows'
  Total samples: 1
  Maximum: 11 msec
  Minimum: 11 msec
  95th percentile: 0.000000 msec
  Short term average: 11.000000 msec
  Long term average: 11.000000 msec
Statistics for 'ovnnb_db_run'
  Total samples: 1
  Maximum: 3 msec
  Minimum: 3 msec
  95th percentile: 0.000000 msec
  Short term average: 3.000000 msec
  Long term average: 3.000000 msec

Adding 1000 logical routers and linking them to switches

real    0m59.369s
user    0m28.628s
sys     0m11.081s

Stopwatch stats after adding routers
Statistics for 'build_lflows'
  Total samples: 900
  Maximum: 93 msec
  Minimum: 11 msec
  95th percentile: 72.889383 msec
  Short term average: 72.416187 msec
  Long term average: 65.312763 msec
Statistics for 'ovnnb_db_run'
  Total samples: 815
  Maximum: 31 msec
  Minimum: 2 msec
  95th percentile: 22.378539 msec
  Short term average: 21.154184 msec
  Long term average: 19.508222 msec

Stopwatches after a recompute
Statistics for 'build_lflows'
  Total samples: 1
  Maximum: 71 msec
  Minimum: 71 msec
  95th percentile: 0.000000 msec
  Short term average: 71.000000 msec
  Long term average: 71.000000 msec
Statistics for 'ovnnb_db_run'
  Total samples: 1
  Maximum: 23 msec
  Minimum: 23 msec
  95th percentile: 0.000000 msec
  Short term average: 23.000000 msec
  Long term average: 23.000000 msec

Timing an nbctl sync

real    0m0.007s
user    0m0.003s
sys     0m0.002s

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to