EventBus icon indicating copy to clipboard operation
EventBus copied to clipboard

Adds IEvent interface for Record event support

Open danorris709 opened this issue 1 year ago • 2 comments

Adds, and migrates all references, to the IEvent interface to allow creating record based events in the future.

I'm not sure if this was the correct way to do this, but I ran the tests against everything I changed, and added one for the Record events because I wasn't sure it'd work with phases, and they passed. I was going to run the performance tests, and see if there was any notable difference for records, but it was giving a 12 hour ETA so I decided against doing that.

danorris709 avatar Feb 19 '24 23:02 danorris709

Benchmarks take a long time because it tests on a huge amount of JVMs by default iirc. You can speed this up by changing the VALID_VMS in the root build.gradle to only have Microsoft 17 and 21.

PaintNinja avatar Feb 20 '24 01:02 PaintNinja

Thanks for your PR. Did a quick code review on my phone, looks good. Assigning to Lex for further testing.

In terms of performance, I expect record component getters to be faster than normal class getter methods, but event posting and subscribing to be around the same as normal classes. Even if performance ends up being the same, having the record syntax for some events would be nice.

My assumption was that the record events might gain some performance from the default implementation on methods such as isCanceled where they assume always false.

Either way, I'll re-run them on a smaller sample size as you suggested and get back with the results.

danorris709 avatar Feb 20 '24 05:02 danorris709