Skip to content

Commit 877cd20

Browse files
committed
Typo fixes.
- Removed extraneous "but" in paragraph 1. - Changed "away" to "a way" in paragraph 1.
1 parent 23bbd2e commit 877cd20

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

1-Beginner/Personal-Skills/07-How to Optimize Loops.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# How to Optimize Loops
22

3-
Sometimes you'll encounter loops, or recursive functions, that take a long time to execute and are bottlenecks in your product. Before you try to make the loop a little faster, but spend a few minutes considering if there is a way to remove it entirely. Would a different algorithm do? Could you compute that while computing something else? If you can't find away around it, then you can optimize the loop. This is simple; move stuff out. In the end, this will require not only ingenuity but also an understanding of the expense of each kind of statement and expression. Here are some suggestions:
3+
Sometimes you'll encounter loops, or recursive functions, that take a long time to execute and are bottlenecks in your product. Before you try to make the loop a little faster, spend a few minutes considering if there is a way to remove it entirely. Would a different algorithm do? Could you compute that while computing something else? If you can't find a way around it, then you can optimize the loop. This is simple; move stuff out. In the end, this will require not only ingenuity but also an understanding of the expense of each kind of statement and expression. Here are some suggestions:
44

55
- Remove floating point operations.
66
- Don't allocate new memory blocks unnecessarily.
@@ -12,4 +12,4 @@ Sometimes you'll encounter loops, or recursive functions, that take a long time
1212

1313
The cost of each of these operations depends on your specific system. On some systems compilers and hardware do these things for you. Clear, efficient code is better than code that requires an understanding of a particular platform.
1414

15-
Next [How to Deal with I/O Expense](08-How to Deal with IO Expense.md)
15+
Next [How to Deal with I/O Expense](08-How to Deal with IO Expense.md)

0 commit comments

Comments
 (0)