Algorithmic Optimizations Flashcards

1
Q

What is Strength Reduction?

A

Replace expensive operations with simpler ones.

i.e simplifying use logical and mathematical identities or using addition instead of multiplication

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an inline Routine?

A

Replacing function call with the body of the method being called. This reduces overhead from call stack and updating pointers. However, this also gives calling method extra access to variables, code duplication in binary file and increase/decrease cache misses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is low-level routine?

A

Switching out to a lower level language to write a routine. i.e switching from java to C++ or switching from C++ to assembly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is re-write routine?

A

re-write built in functions in language so that they are less expensive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Pre-computation?

A

Idea: better to do work at compile time instead of runtime.

Good way to achieve this is to precompute values and store in constants, arrays or file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Data Types?

A

Use simplest data type possible. i.e int instead of float or use primitive instead of object.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Array indexing?

A
  • Orient arrays around language i.e Java and C++ are row major languages
  • Reducing array dimensions saves computation
  • Minimize array references saves time as well
How well did you know this?
1
Not at all
2
3
4
5
Perfectly