Skip to content

Commit 441070c

Browse files
PRO->PRO and CON->Con
they are not acronyms
1 parent 141356d commit 441070c

File tree

1 file changed

+44
-44
lines changed

1 file changed

+44
-44
lines changed

CppCoreGuidelines.md

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# <a name="main"></a>C++ Core Guidelines
22

3-
July 25, 2016
3+
July 28, 2016
44

55
Editors:
66

@@ -35,7 +35,7 @@ You can [read an explanation of the scope and structure of this Guide](#S-abstra
3535
* [Enum: Enumerations](#S-enum)
3636
* [R: Resource management](#S-resource)
3737
* [ES: Expressions and statements](#S-expr)
38-
* [PER: Performance](#S-performance)
38+
* [Per: Performance](#S-performance)
3939
* [CP: Concurrency](#S-concurrency)
4040
* [E: Error handling](#S-errors)
4141
* [Con: Constants and immutability](#S-const)
@@ -49,7 +49,7 @@ Supporting sections:
4949
* [A: Architectural Ideas](#S-A)
5050
* [N: Non-Rules and myths](#S-not)
5151
* [RF: References](#S-references)
52-
* [PRO: Profiles](#S-profile)
52+
* [Pro: Profiles](#S-profile)
5353
* [GSL: Guideline support library](#S-gsl)
5454
* [NL: Naming and layout](#S-naming)
5555
* [FAQ: Answers to frequently asked questions](#S-faq)
@@ -322,14 +322,14 @@ Recommended information sources can be found in [the references](#S-references).
322322
* [SL: The Standard library](#S-stdlib)
323323
* [SF: Source files](#S-source)
324324
* [CPL: C-style programming](#S-cpl)
325-
* [PRO: Profiles](#S-profile)
325+
* [Pro: Profiles](#S-profile)
326326
* [GSL: Guideline support library](#S-gsl)
327327
* [FAQ: Answers to frequently asked questions](#S-faq)
328328

329329
Supporting sections:
330330

331331
* [NL: Naming and layout](#S-naming)
332-
* [PER: Performance](#S-performance)
332+
* [Per: Performance](#S-performance)
333333
* [N: Non-Rules and myths](#S-not)
334334
* [RF: References](#S-references)
335335
* [Appendix A: Libraries](#S-libraries)
@@ -10543,7 +10543,7 @@ This also applies to `%`.
1054310543

1054410544
* Flag division by an integral value that could be zero
1054510545

10546-
# <a name="S-performance"></a>PER: Performance
10546+
# <a name="S-performance"></a>Per: Performance
1054710547

1054810548
??? should this section be in the main guide???
1054910549

@@ -10554,25 +10554,25 @@ Do not blindly try to follow them in general code: achieving the goals of low la
1055410554

1055510555
Performance rule summary:
1055610556

10557-
* [PER.1: Don't optimize without reason](#Rper-reason)
10558-
* [PER.2: Don't optimize prematurely](#Rper-Knuth)
10559-
* [PER.3: Don't optimize something that's not performance critical](#Rper-critical)
10560-
* [PER.4: Don't assume that complicated code is necessarily faster than simple code](#Rper-simple)
10561-
* [PER.5: Don't assume that low-level code is necessarily faster than high-level code](#Rper-low)
10562-
* [PER.6: Don't make claims about performance without measurements](#Rper-measure)
10563-
* [PER.10: Rely on the static type system](#Rper-type)
10564-
* [PER.11: Move computation from run time to compile time](#Rper-Comp)
10565-
* [PER.12: Eliminate redundant aliases](#Rper-alias)
10566-
* [PER.13: Eliminate redundant indirections](#Rper-indirect)
10567-
* [PER.14: Minimize the number of allocations and deallocations](#Rper-alloc)
10568-
* [PER.15: Do not allocate on a critical branch](#Rper-alloc0)
10569-
* [PER.16: Use compact data structures](#Rper-compact)
10570-
* [PER.17: Declare the most used member of a time-critical struct first](#Rper-struct)
10571-
* [PER.18: Space is time](#Rper-space)
10572-
* [PER.19: Access memory predictably](#Rper-access)
10573-
* [PER.30: Avoid context switches on the critical path](#Rper-context)
10557+
* [Per.1: Don't optimize without reason](#Rper-reason)
10558+
* [Per.2: Don't optimize prematurely](#Rper-Knuth)
10559+
* [Per.3: Don't optimize something that's not performance critical](#Rper-critical)
10560+
* [Per.4: Don't assume that complicated code is necessarily faster than simple code](#Rper-simple)
10561+
* [Per.5: Don't assume that low-level code is necessarily faster than high-level code](#Rper-low)
10562+
* [Per.6: Don't make claims about performance without measurements](#Rper-measure)
10563+
* [Per.10: Rely on the static type system](#Rper-type)
10564+
* [Per.11: Move computation from run time to compile time](#Rper-Comp)
10565+
* [Per.12: Eliminate redundant aliases](#Rper-alias)
10566+
* [Per.13: Eliminate redundant indirections](#Rper-indirect)
10567+
* [Per.14: Minimize the number of allocations and deallocations](#Rper-alloc)
10568+
* [Per.15: Do not allocate on a critical branch](#Rper-alloc0)
10569+
* [Per.16: Use compact data structures](#Rper-compact)
10570+
* [Per.17: Declare the most used member of a time-critical struct first](#Rper-struct)
10571+
* [Per.18: Space is time](#Rper-space)
10572+
* [Per.19: Access memory predictably](#Rper-access)
10573+
* [Per.30: Avoid context switches on the critical path](#Rper-context)
1057410574

10575-
### <a name="Rper-reason"></a>PER.1: Don't optimize without reason
10575+
### <a name="Rper-reason"></a>Per.1: Don't optimize without reason
1057610576

1057710577
##### Reason
1057810578

@@ -10584,15 +10584,15 @@ Some people optimize out of habit or because it's fun.
1058410584

1058510585
???
1058610586

10587-
### <a name="Rper-Knuth"></a>PER.2: Don't optimize prematurely
10587+
### <a name="Rper-Knuth"></a>Per.2: Don't optimize prematurely
1058810588

1058910589
##### Reason
1059010590

1059110591
Elaborately optimized code is usually larger and harder to change than unoptimized code.
1059210592

1059310593
???
1059410594

10595-
### <a name="Rper-critical"></a>PER.3: Don't optimize something that's not performance critical
10595+
### <a name="Rper-critical"></a>Per.3: Don't optimize something that's not performance critical
1059610596

1059710597
##### Reason
1059810598

@@ -10605,10 +10605,10 @@ If your program spends most of its time waiting for the web or for a human, opti
1060510605
Put another way: If your program spends 4% of its processing time doing
1060610606
computation A and 40% of its time doing computation B, a 50% improvement on A is
1060710607
only as impactful as a 5% improvement on B. (If you don't even know how much
10608-
time is spent on A or B, see <a href="#Rper-reason">PER.1</a> and <a
10609-
href="#Rper-Knuth">PER.2</a>.)
10608+
time is spent on A or B, see <a href="#Rper-reason">Per.1</a> and <a
10609+
href="#Rper-Knuth">Per.2</a>.)
1061010610

10611-
### <a name="Rper-simple"></a>PER.4: Don't assume that complicated code is necessarily faster than simple code
10611+
### <a name="Rper-simple"></a>Per.4: Don't assume that complicated code is necessarily faster than simple code
1061210612

1061310613
##### Reason
1061410614

@@ -10641,7 +10641,7 @@ Simple code can be very fast. Optimizers sometimes do marvels with simple code
1064110641

1064210642
???
1064310643

10644-
### <a name="Rper-low"></a>PER.5: Don't assume that low-level code is necessarily faster than high-level code
10644+
### <a name="Rper-low"></a>Per.5: Don't assume that low-level code is necessarily faster than high-level code
1064510645

1064610646
##### Reason
1064710647

@@ -10653,7 +10653,7 @@ Low-level code sometimes inhibits optimizations. Optimizers sometimes do marvels
1065310653

1065410654
???
1065510655

10656-
### <a name="Rper-measure"></a>PER.6: Don't make claims about performance without measurements
10656+
### <a name="Rper-measure"></a>Per.6: Don't make claims about performance without measurements
1065710657

1065810658
##### Reason
1065910659

@@ -10673,55 +10673,55 @@ Often, you will be surprised.
1067310673

1067410674
???
1067510675

10676-
### <a name="Rper-type"></a>PER.10: Rely on the static type system
10676+
### <a name="Rper-type"></a>Per.10: Rely on the static type system
1067710677

1067810678
##### Reason
1067910679

1068010680
Type violations, weak types (e.g. `void*`s), and low level code (e.g., manipulation of sequences as individual bytes) make the job of the optimizer much harder. Simple code often optimizes better than hand-crafted complex code.
1068110681

1068210682
???
1068310683

10684-
### <a name="Rper-Comp"></a>PER.11: Move computation from run time to compile time
10684+
### <a name="Rper-Comp"></a>Per.11: Move computation from run time to compile time
1068510685

1068610686
???
1068710687

10688-
### <a name="Rper-alias"></a>PER.12: Eliminate redundant aliases
10688+
### <a name="Rper-alias"></a>Per.12: Eliminate redundant aliases
1068910689

1069010690
???
1069110691

10692-
### <a name="Rper-indirect"></a>PER.13: Eliminate redundant indirections
10692+
### <a name="Rper-indirect"></a>Per.13: Eliminate redundant indirections
1069310693

1069410694
???
1069510695

10696-
### <a name="Rper-alloc"></a>PER.14: Minimize the number of allocations and deallocations
10696+
### <a name="Rper-alloc"></a>Per.14: Minimize the number of allocations and deallocations
1069710697

1069810698
???
1069910699

10700-
### <a name="Rper-alloc0"></a>PER.15: Do not allocate on a critical branch
10700+
### <a name="Rper-alloc0"></a>Per.15: Do not allocate on a critical branch
1070110701

1070210702
???
1070310703

10704-
### <a name="Rper-compact"></a>PER.16: Use compact data structures
10704+
### <a name="Rper-compact"></a>Per.16: Use compact data structures
1070510705

1070610706
##### Reason
1070710707

1070810708
Performance is typically dominated by memory access times.
1070910709

1071010710
???
1071110711

10712-
### <a name="Rper-struct"></a>PER.17: Declare the most used member of a time-critical struct first
10712+
### <a name="Rper-struct"></a>Per.17: Declare the most used member of a time-critical struct first
1071310713

1071410714
???
1071510715

10716-
### <a name="Rper-space"></a>PER.18: Space is time
10716+
### <a name="Rper-space"></a>Per.18: Space is time
1071710717

1071810718
##### Reason
1071910719

1072010720
Performance is typically dominated by memory access times.
1072110721

1072210722
???
1072310723

10724-
### <a name="Rper-access"></a>PER.19: Access memory predictably
10724+
### <a name="Rper-access"></a>Per.19: Access memory predictably
1072510725

1072610726
##### Reason
1072710727

@@ -10741,7 +10741,7 @@ Performance is very sensitive to cache performance and cache algorithms favor si
1074110741
for (int c = 0; c < cols; ++c)
1074210742
sum += matrix[r][c];
1074310743

10744-
### <a name="Rper-context"></a>PER.30: Avoid context switches on the critical path
10744+
### <a name="Rper-context"></a>Per.30: Avoid context switches on the critical path
1074510745

1074610746
???
1074710747

@@ -15853,7 +15853,7 @@ Thanks to the many people who contributed rules, suggestions, supporting informa
1585315853

1585415854
and see the contributor list on the github.
1585515855

15856-
# <a name="S-profile"></a>PRO: Profiles
15856+
# <a name="S-profile"></a>Pro: Profiles
1585715857

1585815858
A "profile" is a set of deterministic and portably enforceable subset rules (i.e., restrictions) that are designed to achieve a specific guarantee. "Deterministic" means they require only local analysis and could be implemented in a compiler (though they don't need to be). "Portably enforceable" means they are like language rules, so programmers can count on enforcement tools giving the same answer for the same code.
1585915859

@@ -15884,7 +15884,7 @@ To suppress enforcement of a profile check, place a `suppress` annotation on a l
1588415884
Now `raw_find()` can scramble memory to its heart's content.
1588515885
Obviously, suppression should be very rare.
1588615886

15887-
## <a name="SS-type"></a>PRO.safety: Type safety profile
15887+
## <a name="SS-type"></a>Pro.safety: Type safety profile
1588815888

1588915889
This profile makes it easier to construct code that uses types correctly and avoids inadvertent type punning.
1589015890
It does so by focusing on removing the primary sources of type violations, including unsafe uses of casts and unions.

0 commit comments

Comments
 (0)