Commit 822a9dd
[SharedCache] Optimize parsing of slide info
Slide info is parsed and applied on the main thread, below the
`SharedCache` constructor, when a shared cache is opened. Time spent
applying the slide is time that the main thread is blocked.
These changes eliminate some unnecessary overhead so what work remains
is dominated by kernel work (paging in data, copying pages when the
first modification is made).
The changes are:
1. Read slide pointers via `ReadULong` rather than the variable-length
`Read` method. The compiler isn't able to eliminate the call to
`memcpy` in the variable-length `Read` function, and the function
call overhead is noticeable given the small size of the read and
number of times it is called.
2. Remove the file member from `MappingInfo`. Slide info is applied for
a single file at a time so there's no reason to track the file it
belongs to. This removes unnecesssary reference counting on the
`std::shared_ptr` that holds the `MMappedFileAccessor`.1 parent f68c0ef commit 822a9dd
File tree
2 files changed
+6
-11
lines changed2 files changed
+6
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1157 | 1157 | | |
1158 | 1158 | | |
1159 | 1159 | | |
1160 | | - | |
1161 | 1160 | | |
1162 | 1161 | | |
1163 | 1162 | | |
| |||
1183 | 1182 | | |
1184 | 1183 | | |
1185 | 1184 | | |
1186 | | - | |
1187 | 1185 | | |
1188 | 1186 | | |
1189 | 1187 | | |
| |||
1251 | 1249 | | |
1252 | 1250 | | |
1253 | 1251 | | |
1254 | | - | |
| 1252 | + | |
1255 | 1253 | | |
1256 | 1254 | | |
1257 | 1255 | | |
| |||
1301 | 1299 | | |
1302 | 1300 | | |
1303 | 1301 | | |
1304 | | - | |
| 1302 | + | |
1305 | 1303 | | |
1306 | 1304 | | |
1307 | 1305 | | |
| |||
1340 | 1338 | | |
1341 | 1339 | | |
1342 | 1340 | | |
1343 | | - | |
| 1341 | + | |
1344 | 1342 | | |
1345 | 1343 | | |
1346 | 1344 | | |
| |||
1352 | 1350 | | |
1353 | 1351 | | |
1354 | 1352 | | |
1355 | | - | |
1356 | | - | |
| 1353 | + | |
1357 | 1354 | | |
1358 | 1355 | | |
1359 | 1356 | | |
| |||
1395 | 1392 | | |
1396 | 1393 | | |
1397 | 1394 | | |
1398 | | - | |
| 1395 | + | |
1399 | 1396 | | |
1400 | 1397 | | |
1401 | 1398 | | |
| |||
1407 | 1404 | | |
1408 | 1405 | | |
1409 | 1406 | | |
1410 | | - | |
1411 | | - | |
| 1407 | + | |
1412 | 1408 | | |
1413 | 1409 | | |
1414 | 1410 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
514 | | - | |
515 | 514 | | |
516 | 515 | | |
517 | 516 | | |
| |||
0 commit comments