User forums > Using Code::Blocks

Code::Blocks very slow to open long files

<< < (4/6) > >>

Dahman:

--- Quote ---This means that the slow-down time is now cut in half. That's something, at least.
--- End quote ---

Yes, if you know how many times I must open my log file, that is more than "something"
Thanks and I hope you can fix definitely this problem.

Dahman

thomas:

--- Quote from: mandrav on May 07, 2008, 01:47:27 pm ---Unfortunately, I 'm not sure we can do anything about that... :(
--- End quote ---

Try compiling with -DwxNEED_WX_MBSTOWCS.

mandrav:

--- Quote from: thomas on May 07, 2008, 02:15:51 pm ---
--- Quote from: mandrav on May 07, 2008, 01:47:27 pm ---Unfortunately, I 'm not sure we can do anything about that... :(
--- End quote ---

Try compiling with -DwxNEED_WX_MBSTOWCS.

--- End quote ---

I 'd be happy to but, even if that fixed it, that would mean that each user would have to do the same (instead of using a package from a repository). Not a nice thing to do.

thomas:
Well, I meant rather something like "put a line into the makefile that adds this switch for Ubuntu" (supposed that it actually works) :)

I'm not even sure it will work, but there's an #ifdef in the code which suggests that it might...

Biplab:

--- Quote from: mandrav on May 07, 2008, 01:47:27 pm ---Yes, I can confirm it's the call to mbsrtowcs that's causing the slow down. Unfortunately, I 'm not sure we can do anything about that... :(

--- End quote ---

Unfortunately mbsrtowcs (defined in wchar.h ) is not the cause. It's the mbstowcs (defined in stdlib.h ) which is causing this slowdown. Though I don't know the difference.

In <wx/wxcrtbase.h> file (line:580):

--- Code: ---#ifdef wxNEED_WX_MBSTOWCS
    /* even though they are defined and "implemented", they are bad and just
       stubs so we need our own - we need these even in ANSI builds!! */
    WXDLLIMPEXP_BASE size_t wxMbstowcs(wchar_t *, const char *, size_t);
    WXDLLIMPEXP_BASE size_t wxWcstombs(char *, const wchar_t *, size_t);
#else
    #define wxMbstowcs mbstowcs
    #define wxWcstombs wcstombs
#endif
--- End code ---


In src/common/wxcrt.cpp file (line:88):

--- Code: ---#ifdef HAVE_WCSRTOMBS
    return mbsrtowcs(buf, &psz, n, &mbstate);
#else
    return wxMbstowcs(buf, psz, n);
#endif
--- End code ---

And this HAVE_WCSRTOMBS macro is defined only for Metroworks compiler on Mac.

I'm not sure why they have used mbsrtowcs() only for Mac when the wxchar.h header is available on different platforms?? :?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version