-
Notifications
You must be signed in to change notification settings - Fork 0
test #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
test #8
Conversation
yurii-litvinov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Комментарии к коммитам ужасны :) И CI ругается, что тесты не проходят (потому что многопоточный вариант не работает, потому что Вы забыли Task.WhenAll или что-нибудь вроде.
|
|
||
| <PropertyGroup> | ||
| <OutputType>Exe</OutputType> | ||
| <TargetFramework>net5.0</TargetFramework> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Все уже на .NET 6 перешли
| Количество повторов: 1000. | ||
| Паралельная сортировка: | ||
| Матожидание = 0,005 | ||
| Среднеквадратичное отклонение = 0,1580348062927937 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Среднеквадратичное отклонение на два порядка больше матожидания, это не нормально
| Результаты на массивах размером 1000. | ||
| Количество повторов: 1000. | ||
| Паралельная сортировка: | ||
| Матожидание = 0,005 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Надо указывать размерность величин
| { | ||
| array[i] = rand.Next(100); | ||
| } | ||
| var array1 = array; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Это не понадобилось, да и в принципе создавать ещё одну ссылку на тот же массив не уверен, что может быть тут полезно
|
|
||
| namespace QSort | ||
| { | ||
| public class QSort<T> where T:IComparable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Нужны комментарии
|
|
||
| namespace QSort | ||
| { | ||
| public class QSort<T> where T:IComparable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| public class QSort<T> where T:IComparable | |
| public class QSort<T> where T: IComparable |
| { | ||
| public class QSort<T> where T:IComparable | ||
| { | ||
| private IList<T> List; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| private IList<T> List; | |
| private IList<T> list; |
camelCase же. Если Вы и HwProj так пишете, мы все обречены :)
| task[0] = Task.Run(() => SortCallMulti(start, partition - 1)); | ||
| task[1] = Task.Run(() => SortCallMulti(partition + 1, end)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А что с ними потом происходит? Их никто не ждёт, их никто не хранит даже. Мы просто тут пожелали, чтобы когда-нибудь эти лямбды отработали, и всё :)
| { | ||
| public class Statistics | ||
| { | ||
| public static void CollectStatisticsFromMatrix(int lenght, int count) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Думаю, что это уже не матрица. И lenght пишется как length
| private static int[] GenerateArray(int lenght) | ||
| { | ||
| var array = new int[lenght]; | ||
| var random = new Random(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Создавать тысячу Random-ов может быть плохой идеей по двум причинам:
- они все делают одно и то же, а память жрут
- Random инициализируется текущим временем в миллисекундах от начала Эпохи, так что если в одну миллисекунду GenerateArray вызвался дважды, он сгенерит два одинаковых массива
Лучше создать его один раз и передавать сюда.
No description provided.