Search code examples
c++windowsperformancewxwidgets

wxWidgets wxConfBase Write very slow


I'm using wxConfBase to save the data of my text box. (windows)

config = new wxConfig(wxT("soft"));
    config->Write(wxT("COM"),temp_port->GetValue());
    config->Write(wxT("SQL_HOST"),mainset_sql_host->GetValue());
    config->Write(wxT("SQL_DB"),mainset_sql_db->GetValue());
    config->Write(wxT("SQL_LOGIN"),mainset_sql_login->GetValue());
    config->Write(wxT("SQL_PASS"),mainset_sql_pass->GetValue());
  {.......}
delete config;

I call that on my closing function.

The fact is that it's extremely slow, takes about 10 secs (program freezed) to write about 20 param.

I believe it's write on my local disk, as i've not been able to find out where the hell is that saved, even trying using config->SetPath.

Also the access to the files on my computer doesn't seems to be that slow...

Also maybe there is some more efficient way than using config-write.

If anyone get an idea, thanks.


Solution

  • For given name "soft":

    Windows: wxConfig writes to HKEY_CURRENT_USER\Software\soft.

    Linux: wxConfig creates hidden .soft file in home directory.

    Using wxConfig in both OS, I didn't have any performance problems. Try to investigate more, knowing where this information is saved.