You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
800B

  1. #![feature(test)]
  2. extern crate rosc;
  3. extern crate test;
  4. use self::test::Bencher;
  5. #[bench]
  6. fn bench_decode(b: &mut Bencher) {
  7. // The message was captured from the `ytterbium` lemur patch looks like this:
  8. // OSC Bundle: OscBundle { timetag: Time(0, 1), content: [Message(OscMessage { addr: "/OSCILLATORS/OSC2/ADSR/x", args: Some([Float(0.1234567), Float(0.1234567), Float(0.1234567), Float(0.1234567)]) })] }
  9. let raw_msg: [u8; 72] = [
  10. 35, 98, 117, 110, 100, 108, 101, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 52, 47, 79, 83, 67,
  11. 73, 76, 76, 65, 84, 79, 82, 83, 47, 79, 83, 67, 50, 47, 65, 68, 83, 82, 47, 122, 0, 0, 0,
  12. 0, 44, 102, 102, 102, 102, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  13. ];
  14. b.iter(|| rosc::decoder::decode(&raw_msg).unwrap());
  15. }