Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
54 lines (47 sloc) 2.96 KB

benchmark-object-vs-array

see more: https://try-catch.pl/2019/11/02/mit-o-kolekcjach/

Test #1

Collection size Aprox. time (μs) Min. time (μs) Max. time (μs) Aprox. memory (B) Min. memory (B) Max. memory (B)
Object 100 72 66 86 152 152 152
Array 100 70 65 79 152 152 152
Object 500 94 78 122 152 152 152
Array 500 90 83 106 152 152 152
Object 1000 101 93 114 152 152 152
Array 1000 108 106 110 152 152 152
Object 20000 3,19ms 2,93ms 3,64ms 3,82k 3,82k 3,82k
Array 20000 1,85ms 1,76ms 1,96ms 3,82k 3,82k 3,82k
Object 100000 12,2ms 11,9ms 12,4ms 3,82k 3,82k 3,82k
Array 100000 20ms 19,8ms 21,6ms 3,82k 3,82k 3,82k
Object 300000 57,9ms 55,9ms 59,2ms 3,82k 3,82k 3,82k
Array 300000 64,7ms 64,1ms 66,5ms 3,82k 3,82k 3,82k

Test #2

Collection size Aprox. time (μs) Min. time (μs) Max. time (μs) Aprox. memory (B) Min. memory (B) Max. memory (B)
Object 100 66 61 77 152 152 152
Array 100 80 72 92 528 528 528
Object 500 77 73 84 152 152 152
Array 500 109 101 120 528 528 528
Object 1000 90 84 97 152 152 152
Array 1000 146 142 151 528 528 528
Object 20000 3,13ms 2,87ms 3,32ms 3,82k 3,82k 3,82k
Array 20000 1,72ms 1,7ms 1,74ms 528 528B 528
Object 100000 11,28ms 10,9ms 11,8ms 3,82k 3,82k 3,82k
Array 100000 8,19ms 8,03ms 8,27ms 528 528 528
Object 300000 54,48ms 53,1ms 56,1ms 3,82k 3,82k 3,82k
Array 300000 23,9ms 23,3ms 35,6ms 528 528 528

Test #3

Collection size Aprox. time (μs) Min. time (μs) Max. time (μs) Aprox. memory (B) Min. memory (B) Max. memory (B)
Object 100 74 64 98 8,4k 8,4k 8,4k
Array 100 79 69 97 8,78k 8,78k 8,78k
Object 500 81 74 90 20,7k 20,7k 20,7k
Array 500 119 104 134 21,1k 21,1k 21,1k
Object 1000 95 92 102 37,1k 37,1k 37,1k
Array 1000 156 144 172 37,4k 37,4k 37,4k
Object 20000 3,54ms 3,17ms 4,15ms 1,05M 1,05M 1,05M
Array 20000 1,87ms 1,81ms 1,98ms 1,05M 1,05M 1,05M
Object 100000 12,8ms 12,5ms 13,3ms 4,2M 4,2M 4,2M
Array 100000 9,75ms 9,72ms 9,86ms 4,2M 4,2M 4,2M
Object 300000 60,5ms 59,5ms 62,3ms 16,8M 16,8M 16,8M
Array 300000 29,28ms 29,1ms 29,5ms 16,8M 16,8M 16,8M
You can’t perform that action at this time.