These exercises check that you have understood the prg1 and prg1-opt instructions, help you to start working for the prg1, and verify that you know how to test locally your code.
All questions relate to the prg1 documentation.
All questions concern prg1 instructions on testing. The perftest outputs later in this exercise are not real data, the data should not be used for comparison with your own implementation.
test
all_places
testread
-in.txt
-out.txt
perftest
Next couple of questions consider the perftest output below
> perftest 10*all_places 10 100;1000;10000;100000 Timeout for each N is 10 sec (for ADD and test functions). For each N perform command(s): all_places N , add (sec) , cmds (sec) , total (sec) 100 , 0.5000000 , 1.000000000 , 1.5000000 1000 , 1.000000 , 2.00000000 , 3.000000 10000 , 5.00000 , 4.0000000 , 9.00000 100000 , ADD Timeout! >
> perftest 10*all_places 20 100;1000;10000;100000 Timeout for each N is 20 sec (for ADD and test functions). For each N perform command(s): all_places N , add (sec) , cmds (sec) , total (sec) 100 , 0.500000000 , 3.000000 , 3.500000 1000 , 1.00000000 , 6.00000 , 7.00000 10000 , 5.0000000 , 12.0000 , 17.000 100000 , 8.0000000 , Timeout! >
Timeout!
> perftest 10*get_place_name 10 5;10;50;100 Timeout for each N is 10 sec (for ADD and test functions). For each N perform command(s): get_place_name N , add (sec) , cmds (sec) , total (sec) 5 , 2.9655e-05 , terminate called after throwing an instance of 'std::out_of_range' what(): unordered_map::at Aborted (core dumped)
get_place_name
unordered_map
> perftest 10*all_places 10 100;1000;10000;100000 Timeout for each N is 10 sec (for ADD and test functions). For each N perform command(s): all_places N , add (sec) , add (count) , cmds (sec) , cmds (count) , total (sec) , total (count) 100 , 0,000112247 , 280203 , 3,5244e-05 , 43740 , 0,000147491 , 323943 1000 , 0,000116914 , 569395 , 3,8864e-05 , 74040 , 0,000155778 , 643435 10000 , 0,00051654 , 2740514 , 8,6724e-05 , 317460 , 0,000603264 , 3057974 100000 , 0,000976794 , 5443984 , 0,000131009 , 619420 , 0,0011078 , 6063404 >