Search found 162 matches

by Ronald
Wed Mar 14, 2018 4:31 pm
Forum: Open Discussion
Topic: Why do they switch from wxWidgets?
Replies: 9
Views: 5799

Why do they switch from wxWidgets?

I'm familiar with MFC, but it's not well suported by M$ now, then I choosed wxWidgets against others, because I think it's more professional, but why do they swith from wxWidgets? 1. pgAdmin pgAdmin3: wxWidgets pgAdmin4: Python and JS 2. VLC The default GUI is based on Be API on BeOS, Cocoa for macO...
by Ronald
Thu Mar 08, 2018 4:14 pm
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

marcelinux wrote:
The C++ programming language
Chapter 6.
Expressions and Statements

Premature optimization
is the root of all evil.
– D. Knuth

On the other hand,
we cannot ignore efficiency.
– Jon Bentley
Sure, thanks.
by Ronald
Thu Mar 08, 2018 11:54 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

Yes. Considering multi language, wxString makes more sense. I have spent several days in trying MFC, because 1) it is more efficient for machine 2) the controls can be customized seriously, but found that it was not well supported by M$ now any more. I'll check wxWidgets again. Sincerely, I think y...
by Ronald
Wed Mar 07, 2018 7:01 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

You should never optimize a program without first profiling it. Without knowing where it is slow, you can spend too much time optimizing the wrong parts. And you should never optimize a program until users complain it's too slow. Instead, write the program to be easily understood. A professional pr...
by Ronald
Wed Mar 07, 2018 3:09 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

Yes. But you missed the first point - did you actually profiled the code? Maybe the bottleneck is somewhere else? Thank you. When I'm learning wxWidgets after Qt, I got this question. Qt Doc: Using QStringLiteral instead of a double quoted plain C++ string literal can significantly speed up creatio...
by Ronald
Tue Mar 06, 2018 3:50 pm
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

You should never optimize a program without first profiling it. Without knowing where it is slow, you can spend too much time optimizing the wrong parts. And you should never optimize a program until users complain it's too slow. Instead, write the program to be easily understood. A professional pr...
by Ronald
Tue Mar 06, 2018 11:26 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

With a pointer, the function gets data from the memory the pointer points to without copy the string, the programmer should guarantee what the pointer points to should be valid. It's a const pointer. Which means that a) the called function does not modify it and b) that the called function does not...
by Ronald
Tue Mar 06, 2018 1:37 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

Take Microsoft MFC for comparison, it uses a pointer for string parameter instead of CString Nevertheless, the string data will be copied internally. With a pointer, the function gets data from the memory the pointer points to without copy the string, the programmer should guarantee what the pointe...
by Ronald
Tue Mar 06, 2018 1:34 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

Do you mean _("&New") is more efficient than wxT("&New") ? No, I didn't say anything like that (when I want to optimize an app on speed I'm using the compiler's options, then I profile it to decide what are the blocks of code requiring an added effort from me -- and, first, I choose the right langu...
by Ronald
Mon Mar 05, 2018 3:39 pm
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

I think you should look for performance issues where they matter. Creating GUI elements is not where performance matters. When you create a new gui element there is so much code executed in the background, the string creation is almost negligible. wxWidgets is fast enough, however the faster the be...
by Ronald
Mon Mar 05, 2018 1:20 pm
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

Re: wxString performance

wxT() is not needed anymore since (unless mistake) wxWidgets 3.0. So, you can just create your menu item like this below (and in one line). Here, _() allowing you to translate the label in an associated .mo catalog. wxMenuItem* m_menuItem_new = new wxMenuItem(m_menu_file, wxID_ANY, _("&New"), wxEmp...
by Ronald
Mon Mar 05, 2018 4:27 am
Forum: C++ Development
Topic: wxString performance
Replies: 25
Views: 2881

wxString performance

wxMenuItem* m_menuItem_new; m_menuItem_new = new wxMenuItem( m_menu_file, wxID_ANY, wxString( wxT("&New") ) , wxEmptyString, wxITEM_NORMAL ); Funciton: wxMenuItem::wxMenuItem Parameter: name (the 3rd parameter) Question: Is it not efficient enough to construct a wxString here? Take Qt for example, ...