scaling.rs 712 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. extern crate ralloc;
  2. #[global_allocator]
  3. static ALLOCATOR: ralloc::Allocator = ralloc::Allocator;
  4. mod util;
  5. #[test]
  6. #[ignore]
  7. fn big_alloc() {
  8. util::multiply(|| {
  9. let mut vec = Vec::new();
  10. let mut rand = 3u64;
  11. for _ in 0..0xBFFF {
  12. rand ^= 0xABFABFABFABF;
  13. rand = rand.rotate_left(3);
  14. util::acid(|| vec.push(rand));
  15. }
  16. });
  17. }
  18. #[test]
  19. #[ignore]
  20. fn many_small_allocs() {
  21. util::multiply(|| {
  22. let mut vec = Vec::new();
  23. let mut rand = 3u64;
  24. for _ in 0..3000 {
  25. rand ^= 0xABFABFABFABF;
  26. rand = rand.rotate_left(3);
  27. util::acid(|| vec.push(Box::new(rand)));
  28. }
  29. });
  30. }