SongBrowserModelTests.cs 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using SongBrowserPlugin;
  7. namespace SongBrowserPluginTests
  8. {
  9. class SongBrowserModelTests : ISongBrowserTest
  10. {
  11. private Logger _log = new Logger("SongBrowserModelTests");
  12. public void RunTest()
  13. {
  14. /*_log.Info("SongBrowserModelTests - All tests in Milliseconds");
  15. Stopwatch stopwatch = Stopwatch.StartNew();
  16. SongBrowserModel model = new SongBrowserModel();
  17. model.Init();
  18. stopwatch.Stop();
  19. _log.Info("Created a bunch of LevelStaticData: {0}", stopwatch.ElapsedMilliseconds);
  20. stopwatch = Stopwatch.StartNew();
  21. model.Settings.sortMode = SongSortMode.Original;
  22. model.UpdateSongLists(false);
  23. stopwatch.Stop();
  24. _log.Info("Song Loading and Sorting as original: {0}", stopwatch.ElapsedMilliseconds);
  25. stopwatch = Stopwatch.StartNew();
  26. model.Settings.sortMode = SongSortMode.Default;
  27. model.UpdateSongLists(false);
  28. stopwatch.Stop();
  29. _log.Info("Song Loading and Sorting as favorites: {0}", stopwatch.ElapsedMilliseconds);
  30. stopwatch = Stopwatch.StartNew();
  31. model.Settings.sortMode = SongSortMode.Favorites;
  32. model.UpdateSongLists(false);
  33. stopwatch.Stop();
  34. _log.Info("Song Loading and Sorting as favorites: {0}", stopwatch.ElapsedMilliseconds);
  35. stopwatch = Stopwatch.StartNew();
  36. model.Settings.sortMode = SongSortMode.Newest;
  37. model.UpdateSongLists(false);
  38. stopwatch.Stop();
  39. _log.Info("Song Loading and Sorting as newest: {0}", stopwatch.ElapsedMilliseconds);
  40. stopwatch = Stopwatch.StartNew();
  41. for (int i = 0; i < 1; i++)
  42. {
  43. var m1 = model.SortedSongList.ToArray();
  44. var m2 = model.SortedSongList.ToArray();
  45. var m3 = model.SortedSongList.ToArray();
  46. }
  47. stopwatch.Stop();
  48. _log.Info("Converting big list into array a bunch of times: {0}", stopwatch.ElapsedMilliseconds);*/
  49. }
  50. }
  51. }