Главная / Программирование /
Introduction to performance optimization using Intel SW tools / Тест 9
Introduction to performance optimization using Intel SW tools - тест 9
Упражнение 1:
Номер 1
What disadvantage does static profiler has?
Ответ:
 (1) working only with static variables 
 (2) ignores pointer variables 
 (3) do not supports full type system 
 (4) not precise branch prediction 
 (5) it is necessary to run static profiler for the second time before the program execution 
Номер 2
What is the source for branch prediction in static profiler
Ответ:
 (1) input data 
 (2) base block analysis 
 (3) iterprocedural analysis 
 (4) inlining-analysis 
 (5) run statistics 
Номер 3
Static profiler used
Ответ:
 (1) for statically typed languages 
 (2) for languages without pointers 
 (3) to analyze the application without running 
 (4) to collect run statistics 
 (5) to estimate how static memory map is 
Упражнение 2:
Номер 1
Dynamic profiler benefits are
Ответ:
 (1) statistics is not used 
 (2) more precise branch prediction 
 (3) basic block dynamic estimation 
 (4) more optimizations are available 
Номер 2
What is required for dynamic profiling
Ответ:
 (1) collect run statistics 
 (2) temporary remove all static variables 
 (3) add heap freeing procedure to the beginning of the program 
 (4) choose the most representative input data 
 (5) check program code for inlining 
Номер 3
Dynamic profiler differs from static
Ответ:
 (1) static profiler has more precise branch prediction 
 (2) dynamic profiler uses statistics 
 (3) dynamic profiler doesn't uses statistics 
 (4) dynamic profiler works with pointers 
 (5) dynamic profiler performs seed inlining 
Упражнение 3:
Номер 1
Dynamic data is useful when
Ответ:
 (1) loop iterator changes frequently 
 (2) loop iterator value can be out of data type range 
 (3) you need to create large data structure which size in unknown at compile time 
 (4) you need to store an integer and a string at the same variable 
 (5) you have no run statistics 
Номер 2
Dynamic memory allocation is bad for
Ответ:
 (1) data fragmentation 
 (2) no information passing between dynamic and static objects 
 (3) run statistics cannot be collected 
 (4) code loses its determinism 
 (5) arrays got the slower part of the memory 
Номер 3
Dynamic memory allocation
Ответ:
 (1) leads to run statistics ignore 
 (2) uses memory manager 
 (3) used to distinguish basic blocks 
 (4) required for frequently changed variables 
 (5) necessary to maintain structured data 
Упражнение 4:
Номер 1
Choose the correct statement(s)
Ответ:
 (1) Register count is usually much greater than the number of variables in the program 
 (2) Brush painting method is used for register allocation 
 (3) One of the basic code generator's tasks is register allocation 
Номер 2
Choose the correct statement(s)
Ответ:
 (1) code generator aligns basic blocks in the memory 
 (2) code generator helps to generate big projects 
 (3) code generator performs machine optimizations 
 (4) code generator generates missing parts of the functions 
Номер 3
Choose the correct statement(s)
Ответ:
 (1) code generator estimates jump distances 
 (2) code generator builds the code by representative data array 
 (3) code generator controls dynamic memory 
Упражнение 5:
Номер 1
Register allocation includes
Ответ:
 (1) variable the live range identification 
 (2) mark the most notable registers 
 (3) sort registers by size 
 (4) allocate memory for register block 
Номер 2
Interference graph is built
Ответ:
 (1) for register allocation 
 (2) for reverse engineering 
 (3) for the code contains mistakes 
 (4) for code without representative data array 
Номер 3
What is corresponding entity for the interference graph colors?
Ответ:
 (1) most loaded parts of the program 
 (2) less compatible functions 
 (3) registers 
 (4) arithmetical and logical data conversions 
Упражнение 6:
Номер 1
How data dependencies are used in the code generation?
Ответ:
 (1) to create missing parts of the code 
 (2) to determine the register reuse abillity 
 (3) to take interference functions to the separate graph 
 (4) to find a code didn't match the representative data array 
Номер 2
What instruction scheduling is useful for?
Ответ:
 (1) precise branch prediction 
 (2) instruction parallelism increase 
 (3) compare program checkpoints against the schedule 
 (4) create interference graph 
Номер 3
How does instruction planning performed?
Ответ:
 (1) by changing the instruction order 
 (2) by creating branch probability plan 
 (3) by creating program checkpoint schedule array 
 (4) by ordering instructions inside the interference graph 
Упражнение 7:
Номер 1
How structure field reordering could affect the application performance?
Ответ:
 (1) by simplifying the loops 
 (2) by making results less precise 
 (3) by decreasing cache misses 
 (4) by reducing the number of conditional branches 
Номер 2
What are the aims for the structure splitting?
Ответ:
 (1) moving rarely used fields to separate structure 
 (2) group the fields by the data type 
 (3) group the fields by the basic blocks 
 (4) group the fields by its names 
Номер 3
Why is the pointer chasing useful?
Ответ:
 (1) extra links may lead to unexpected memory freed 
 (2) dereference process is not determined, it's better to avoid non-determinism 
 (3) each dereference involves the cache load, it is significant for big structures 
 (4) it is necessary to avoid extra memory free operations 
 (5) pointer chasing is just code formatting convention which is not related to the program execution speed 
Упражнение 8:
Номер 1
When the linked list is stored inside the memory
Ответ:
 (1) object placement can be not sequential 
 (2) elements can be destroyed any time by garbage collector 
 (3) list cannot contain more than five elements 
Номер 2
How dynamic linked list memory placement can be improved?
Ответ:
 (1) by disabling the garbage collector 
 (2) using speed inlining 
 (3) using containers 
 (4) using multiple processes 
Номер 3
Linked list worse than array for
Ответ:
 (1) increased cache misses for sequentially processed elements 
 (2) decreased available data type set 
 (3) link maintain overhead 
 (4) link values are always changing and the elements are moved across the memory 
Номер 4
Array is better than linked list for
Ответ:
 (1) no link maintain overhead 
 (2) can contain elements with different size 
 (3) modeled according to the statistics collected 
 (4) can contain "record" data type