Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
XDG Integration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Silent mode is enabled
All outbound communications are blocked.
Learn more
.
Show more breadcrumbs
JennaHuntsman
XDG Integration
Commits
2597ed75
Commit
2597ed75
authored
4 years ago
by
Andrey Kleshchev
Browse files
Options
Downloads
Patches
Plain Diff
SL-13443 Reduce stalls on writing cache to file
parent
f18df007
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
indra/newview/llvocache.cpp
+20
-31
20 additions, 31 deletions
indra/newview/llvocache.cpp
with
20 additions
and
31 deletions
indra/newview/llvocache.cpp
+
20
−
31
View file @
2597ed75
...
@@ -347,36 +347,24 @@ void LLVOCacheEntry::dump() const
...
@@ -347,36 +347,24 @@ void LLVOCacheEntry::dump() const
BOOL
LLVOCacheEntry
::
writeToFile
(
LLAPRFile
*
apr_file
)
const
BOOL
LLVOCacheEntry
::
writeToFile
(
LLAPRFile
*
apr_file
)
const
{
{
BOOL
success
;
static
const
S32
data_buffer_size
=
6
*
sizeof
(
S32
);
success
=
check_write
(
apr_file
,
(
void
*
)
&
mLocalID
,
sizeof
(
U32
));
static
U8
data_buffer
[
data_buffer_size
];
if
(
success
)
S32
size
=
mDP
.
getBufferSize
();
{
success
=
check_write
(
apr_file
,
(
void
*
)
&
mCRC
,
sizeof
(
U32
));
memcpy
(
data_buffer
,
&
mLocalID
,
sizeof
(
U32
));
}
memcpy
(
data_buffer
+
sizeof
(
U32
),
&
mCRC
,
sizeof
(
U32
));
if
(
success
)
memcpy
(
data_buffer
+
(
2
*
sizeof
(
U32
)),
&
mHitCount
,
sizeof
(
S32
));
{
memcpy
(
data_buffer
+
(
3
*
sizeof
(
U32
)),
&
mDupeCount
,
sizeof
(
S32
));
success
=
check_write
(
apr_file
,
(
void
*
)
&
mHitCount
,
sizeof
(
S32
));
memcpy
(
data_buffer
+
(
4
*
sizeof
(
U32
)),
&
mCRCChangeCount
,
sizeof
(
S32
));
}
memcpy
(
data_buffer
+
(
5
*
sizeof
(
U32
)),
&
size
,
sizeof
(
S32
));
if
(
success
)
{
BOOL
success
=
check_write
(
apr_file
,
(
void
*
)
data_buffer
,
data_buffer_size
);
success
=
check_write
(
apr_file
,
(
void
*
)
&
mDupeCount
,
sizeof
(
S32
));
if
(
success
)
}
{
if
(
success
)
success
=
check_write
(
apr_file
,
(
void
*
)
mBuffer
,
size
);
{
}
success
=
check_write
(
apr_file
,
(
void
*
)
&
mCRCChangeCount
,
sizeof
(
S32
));
}
return
success
;
if
(
success
)
{
S32
size
=
mDP
.
getBufferSize
();
success
=
check_write
(
apr_file
,
(
void
*
)
&
size
,
sizeof
(
S32
));
if
(
success
)
{
success
=
check_write
(
apr_file
,
(
void
*
)
mBuffer
,
size
);
}
}
return
success
;
}
}
//static
//static
...
@@ -1537,7 +1525,8 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
...
@@ -1537,7 +1525,8 @@ void LLVOCache::writeToCache(U64 handle, const LLUUID& id, const LLVOCacheEntry:
{
{
S32
num_entries
=
cache_entry_map
.
size
()
;
S32
num_entries
=
cache_entry_map
.
size
()
;
success
=
check_write
(
&
apr_file
,
&
num_entries
,
sizeof
(
S32
));
success
=
check_write
(
&
apr_file
,
&
num_entries
,
sizeof
(
S32
));
// This can have a lot of entries, so might be better to dump them into buffer first and write in one go.
for
(
LLVOCacheEntry
::
vocache_entry_map_t
::
const_iterator
iter
=
cache_entry_map
.
begin
();
success
&&
iter
!=
cache_entry_map
.
end
();
++
iter
)
for
(
LLVOCacheEntry
::
vocache_entry_map_t
::
const_iterator
iter
=
cache_entry_map
.
begin
();
success
&&
iter
!=
cache_entry_map
.
end
();
++
iter
)
{
{
if
(
!
removal_enabled
||
iter
->
second
->
isValid
())
if
(
!
removal_enabled
||
iter
->
second
->
isValid
())
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment