Run Code  | API  | Code Wall  | Users  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

Find in vector vs unordered_map

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 1.02 sec, absolute running time: 1.34 sec, cpu time: 1.26 sec, memory peak: 3 Mb, absolute service time: 2,37 sec 
fork mode |  history  | discussion
Vector 
size	 rep	 time (ns)	 per find (ns)
5	1	412	82.4
5	2	263	26.3
5	4	268	13.4
5	8	299	7.475
5	16	413	5.1625
5	32	638	3.9875
5	64	1080	3.375
5	128	2025	3.16406
5	256	3920	3.0625
5	512	6615	2.58398
5	1024	13397	2.6166
5	2048	49217	4.80635
5	4096	72956	3.5623
5	8192	128540	3.13818
5	16384	321817	3.92843
5	32768	516095	3.14999
5	65536	1134509	3.46225
5	131072	2159208	3.29469
5	262144	4196437	3.20163
5	524288	8986645	3.42813

size	 rep	 time (ns)	 per find (ns)
1	1024	1952	1.90625
2	1024	3017	1.47314
4	1024	11199	2.73413
8	1024	31140	3.80127
16	1024	95316	5.81763
32	1024	320092	9.76843
64	1024	1670619	25.4916
128	1024	5674855	43.2957
256	1024	17225263	65.7092
512	1024	60150157	114.727
1024	1024	217000712	206.948
2048	1024	883759198	421.409

UnorderedMap 
size	 rep	 time (ns)	 per find (ns)
5	1	265	53
5	2	250	25
5	4	312	15.6
5	8	459	11.475
5	16	777	9.7125
5	32	1432	8.95
5	64	2778	8.68125
5	128	5356	8.36875
5	256	10828	8.45937
5	512	21569	8.42539
5	1024	42847	8.36855
5	2048	85805	8.37939
5	4096	175814	8.58467
5	8192	339025	8.27698
5	16384	684764	8.35894
5	32768	1362579	8.31652
5	65536	2723965	8.31288
5	131072	5439983	8.30076
5	262144	10910625	8.32415
5	524288	22088053	8.42592

size	 rep	 time (ns)	 per find (ns)
1	1024	2139	2.08887
2	1024	3230	1.57715
4	1024	6207	1.51538
8	1024	12276	1.49854
16	1024	26728	1.63135
32	1024	54688	1.66895
64	1024	105642	1.61197
128	1024	226106	1.72505
256	1024	389148	1.48448
512	1024	808870	1.5428
1024	1024	1741401	1.66073
2048	1024	3340427	1.59284