event-ruler icon indicating copy to clipboard operation
event-ruler copied to clipboard

Benchmark envelop-only vs deep field matching

Open embano1 opened this issue 2 years ago • 5 comments

What is your idea?

Discussed with @baldawar that it would be nice to know, e.g. in README.md whether it's preferable to pattern match on envelop (first-level) fields only or whether there's no significant impact on a match at a lower-level, e.g. Detail.someField.

Would you be willing to make the change?

Maybe, need advise on Java benchmarking.

Additional context

n/a

embano1 avatar Sep 27 '22 08:09 embano1

This requires a new benchmark test within https://github.com/aws/event-ruler/blob/main/src/test/software/amazon/event/ruler/Benchmarks.java that compares performance at different depths.

If the results are noteworthy, then we should also update the performance section within the readme https://github.com/aws/event-ruler/blob/main/README.md#performance

baldawar avatar Sep 29 '22 23:09 baldawar

To be honest I doubt there's much difference. But worth checking.

timbray avatar Sep 30 '22 23:09 timbray

It'll be helpful to have the test focus on depth at different levels more than just envelope vs detail. I've seen some code regress horribly as depth increases because of the data-structures in use while traversing downwards into JSON.

baldawar avatar Oct 06 '22 20:10 baldawar

The matching cost shouldn't differ in the slightest, but the flattening can obviously be affected… I think it'll probably be O(N) in something like the total number of field-steps.

timbray avatar Oct 06 '22 21:10 timbray

Interesting findings in Quamina :)

embano1 avatar Oct 12 '22 06:10 embano1