Test description
Fields description
Algorithm problems
- Test failure - Browsers do code optimalizations when run code again. Than repeating time-test not have true values. Reload page (F5) for reset optimalizations.
- Test failure - But, sometime next similar algorithm work faster (listMergeSort).
- Test failure - Browsers nature-sorting algorithm have optimalizations in c++. And, cannot counting "moves" or "cycles" (but can counting "comparations" by external function). Than, usually faster than other. Not problem, you can ignore it.
- Test failure - Algorithm can be stopped after 500 ms (alg_stop_time) or 140 ms (2x testing_time). Not all output numbers may be correct.
- Test failure - Take je treba zvazit vliv hodnot. Int16 (32.767 / 65.535 / 2^16 - 1), Int32 (2.147.483.647 / 4.294.967.295 / 2^64 - 1), BigUint64Array (2^63 - 1 / 2^64 - 1) nebo string se zpracovavaji odlisne, pomaleji. Takze se snazim omezovat na 32.000. Zas, nahodne cislo 0-32.000 pro array-size=1000 muze byt unikatni a tak vysledek testu pro opakovani se nemusi lisit testu pro jedinecne hodnoty. A taky, pro array-size 300.000 se cisla do 32.000 muzou hodne opakovat, coz zkresli vysledek.
- Test failure - For small array (size=4), you need use "repeating" about 50 times for collect usable measured values.
- Some algorithms needs lot of compare operations. Can be problem, if values have 100 or more characters length. Any one comparation spend lot of time.
- Some algorithms needs lot of compare operations for small arrays than others (x-sort-x2.htm).
- Some algorithms do lot of moves operations.
- Some algorithms do lot of cycles operations.
- Counting sorts (Counting, Radix, Pigeonhole) - Work better only with repeating values.
- Quick sort - Usually failure on array with descending order of values, than work as bubble sort (shuffle = 0 1 2). You can create hybrid sort (two or more algorithms in one) for eliminate this situation.
- Insert sort top - Usually failure on array with ascending or descending order (by code).
- Check repeated value comparisons. If your algorithm compare two values only one time, not repeatly (usually, whe you use swaping). Example: [a,b,c,...] You have in cycle compare a<=b, elsewhere b<=a.
- Check stability. If values is equal, algorithm can swap values order. This is problem, if you need know position in array before-after sorting. As algorithm in ZIP, BWT transformation (BWT create back-chain beetween position before-after to true decode string. And too, stabilized algorithm can be faster.
- Compare operations map = Create binary map of compare operations. (information about algorithm, usage as data transformation)
Measured values
- cmp = Suma some type of compare operation. How many comparations (usually a<=b) for two values of array must algoritm do. Minimal usually equal O(n log n) = (ln(n) / ln(2) - 1) * n + 1
- moves = Suma of moves. How many moves in array (arr[i]=value tmp=arr[i]) must algorithm do.
- cycles = Suma of cycling. How many cycles must algorithm do.
- time = Suma of times. How long must algorithm work. (not irevalant, some code can run 2x faster)
- score = Use my formula for some score value.
- stability = When numbers are equals, unstable algorithm can change order. (Zip for BWT need stable sort)
Note: All measured values have only information character. I try collect it. Note: Counting sorts do some type of compare, not equal to other algoritmus compare.