开发者

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.


You should have a good debug strategy. Try to minimize external influences and make a minimal example. Then try to find out where exactly the program hangs. Is it really the config stuff? Or is it those mainset_sql_* queries?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜