rust-server icon indicating copy to clipboard operation
rust-server copied to clipboard

Skip event Lua to Rust struct conversion if there are no active event streams

Open rkusa opened this issue 2 years ago • 2 comments

Converting an event to a Rust struct is a costly operation (not as costly as Lua -> JSON -> Rust would be though). We should thus update the implementation to only make the conversion if necessary.

Implementation:

  • Check whether either the log level is set to debug, or if there is at least on active events stream.
  • If yes, convert the event to a struct and continue as usual
  • If no, just ignore the event

rkusa avatar Oct 22 '21 07:10 rkusa