juce::File windows optim

Hi Guys,

Wouldn’t it be faster in juce::File on Windows to actually store the WideCharPointer instead of the Juce::String for fullPath ?

It seems there is a conversion each time it is used.

my 2 cents !

It only gets converted to a WCHAR on Windows, and it only happens when it’s needed for to pass into an OS function, at which point the OS call that follows is likely to take hundreds of times longer than doing the string conversion. The vast majority of method calls on File will be string manipulations, so being a String is the best format.

…so I’m surprised you’re asking this! It seems to me like it’d be a really bad de-optimisation rather than anything that’d be of benefit… What made you suggest this?

Saw that in the profiler and it seemed superfluous.

For it to even appear in the optimiser you must have been doing an awful lot of OS file calls… I’m a bit surprised that it’d use enough time to show up, TBH.

Probably because you don’t do apps that load 50000 samples :slight_smile: