GetCaseCorrectPathName is a slow and likely obsolete function, mostly removed from the code.
Removing temporarily its last occurance (by the following test patch) resulted ~10% speed up in LO starting time on Windows.
So it would be fine to remove (or replace it GetLongPathName or something relevant, if needed) finally.
@@ -1666,7 +1666,7 @@ oslFileError SAL_CALL osl_getFileStatus(
if ( uFieldMask & osl_FileStatus_Mask_FileURL )
- if ( !pItemImpl->bFullPathNormalized )
+ if ( 0 && !pItemImpl->bFullPathNormalized )
::osl::LongPathBuffer< sal_Unicode > aBuffer( MAX_LONG_PATH );
sal_uInt32 nNewLen = GetCaseCorrectPathName( rtl_uString_getStr( pItemImpl->m_pFullPath ),
Some information in sal/osl/w32/file_url.cxx:
// Same as GetLongPathName but also 95/NT4
static DWORD GetCaseCorrectPathNameEx(
LPWSTR lpszPath, // path buffer to convert
DWORD cchBuffer, // size of path buffer
BOOL bCheckExistence )
Thanks for the solution, but please follow our guidelines for submitting patches:
We use gerrit to review and apply patches.
Jan - this is an easy-hack; the patch is just to highlight the win possible from optimizing the implementation here =) This is fundamentally a cleanup to use a built-in windows function instead of a hacked-up compatibility implementation.
Hi, I am working on this bug.
Created attachment 132121 [details]
Patch for resolving the Bug
Thanks for the patch ! =) a few comments:
* can you submit it to gerrit ? - it takes a bit of setup - but good to get that done.
* can you remove the dead code rather than commenting it out ? if we had every line of code we'd removed over time still in the source - we would have 50x as much code and it would be un-readable & un-grep-able =)
Otherwise - this looks good; can you test your binaries on Windows XP ? and ensure that this method is triggered & continues to work ? I hope you can just copy your 'instdir' across and run it there.
Created attachment 132143 [details]
Patch for resolving the Bug
A polite ping, still working on this patch?
No reason to be in NEEDINFO state if you ask me.
i Want to solve this bug as my first easy hack . i want to confirm whether i should simply remove all pieces of code where i find the function GetCaseCorrectPathName() called, or something more? .Thank you for your help in advance :)
(In reply to Archit Jugran from comment #9)
> i Want to solve this bug as my first easy hack . i want to confirm whether i
> should simply remove all pieces of code where i find the function
> GetCaseCorrectPathName() called, or something more? .Thank you for your help
> in advance :)
Putting it back to NEW!
@Michael Meeks, Could you please help Archit Jugran here?
The "hack" to be done here is so trivial (especially when there already is a patch attached (that was ignored)), that any help would essentially mean doing the hack for him/her.
Although the patch is there in the comments,written by someone else, but it has not been committed yet. I want to seek the permission to look into it for possible changes and correction if any error arises.
Please do re-do the work yourself, and submit it to gerrit for testing if Archit cannot do this =) Thanks !
A polite ping, still working on this bug?
Sorry for the delay , I am still working on it.
Clearly life means more to him/her than fixing this bug (and I don't deny it) (what am I talking about? check the email address of the assignee), reassigning to default.