ethercrab-rs / ethercrab

EtherCAT master written in pure Rust
258 stars 25 forks source link

Massively simplify frame/PDU code #219

Closed jamwaffles closed 5 months ago

jamwaffles commented 5 months ago

PduMarker became unnecessary and was removed, which is a huge relief as that whole set of code was a horrible hack I was never happy with. Received EtherCAT frames are now matched up to their backing data by parsing out the first PDU index in the frame and doing a linear search over the (up to) 256 frame slots. Benchmark performance improved by ~4% and embedded binary size reduced a lot too:

master:

   text    data     bss     dec     hex filename
  96576     112   57800  154488   25b78 ethercrab-stm32-embassy

This PR:

   text    data     bss     dec     hex filename
  92216     112   57288  149616   24870 ethercrab-stm32-embassy