This optimises #6089 by ensuring that we don't over-walk either the sublist or the subject tree, instead only matching the subject tree on subjects for which the sublist expresses interest.
On my machine, in the JetStreamConsumeWithFilters benchmark with -benchtime 1000x, this reduces the CPU time taken by NumPendingMulti by 19.41 seconds, reducing it to only 0.06 seconds.
This optimises #6089 by ensuring that we don't over-walk either the sublist or the subject tree, instead only matching the subject tree on subjects for which the sublist expresses interest.
On my machine, in the
JetStreamConsumeWithFilters
benchmark with-benchtime 1000x
, this reduces the CPU time taken byNumPendingMulti
by 19.41 seconds, reducing it to only 0.06 seconds.Signed-off-by: Neil Twigg neil@nats.io