Skip to content

Commit 9303efb

Browse files
authored
[no-ci] Update basics.md
1 parent 6c979f1 commit 9303efb

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎doc/basics.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2673,6 +2673,7 @@ Performance tips
26732673
std::string_view year = data["year"];
26742674
std::string_view rating = data["rating"];
26752675
```
2676+
- You will get better performance if you seek the keys in the order in which they appear in the document. So if processing `{"a":1, "b":2, "c":3}`, do `value1 = data["a"]; value2 = data["b"]; value3 data["c"];` and not `value2 = data["b"]; value1 = data["a"]; value3 data["c"];`. Of course, it is not always possible to know for sure in which order the keys appear.
26762677

26772678

26782679

0 commit comments

Comments
 (0)