Author Topic: Codecompletion delays fixed in rev 1826 (update: in rev 1840)  (Read 54484 times)

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« on: January 22, 2006, 02:50:07 am »
Hi all, I'm glad to announce that the long-time delays introduced in the redesign have been fixed in revision 1826 of Code::Blocks. You can use global includes again :-)

The reparsing with cache issue and the 0.5 second delay still remain, tho.
« Last Edit: January 23, 2006, 07:22:31 am by rickg22 »

sethjackson

  • Guest
Re: Codecompletion delays fixed in rev 1826 :)
« Reply #1 on: January 22, 2006, 02:51:59 am »
Bulding rev 1826 right now......  :D Now I have a long-time delay recompiling the SDK.  :P

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codecompletion delays fixed in rev 1826 :)
« Reply #2 on: January 22, 2006, 03:20:45 pm »
Hi all, I'm glad to announce that the long-time delays introduced in the redesign have been fixed in revision 1826 of Code::Blocks. You can use global includes again :-)

Great, thanks :D.

Michael

[EDIT] After building C::B rev1828 and try opening C::B project and ContribPlugins.workspace, the speed is at least 30% higher as before. Good job :D.
« Last Edit: January 22, 2006, 04:34:39 pm by Michael »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codecompletion delays fixed in rev 1826 :)
« Reply #3 on: January 22, 2006, 06:48:24 pm »
Startup when opening the Code::Blocks project takes 7 seconds with code completion on (about 1 second without). Total parse time is now 17 seconds instead of 40 (almost as fast as it used to be). Saving files is instantaneous.

I found two bugs regarding parsing/reparsing:
1. If you change options, you're prompted whether you want to reparse. If you change options again before that reparsing is done, and you answer "yes" another time, Code::Blocks freezes up. Mutex maybe?

2. If you change options and say "yes" to reparse, Code::Blocks will crash on exit if you close the window before the reparse is finished. Funnily, you can otherwise close the window at any time, even if the parse at startup has not finished. The crash only occurs while reparsing.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #4 on: January 23, 2006, 07:24:31 am »
I haven't fixed those bugs yet... I think.

I removed a Mutex and replaced it with a critical section, maybe that'd do the trick with the lockup.

I also removed (now confirmed :D ) the delay at startup!
Additionally, thanks to the SearchTree(TM) class (used for global filenames lookup), I could optimize the global files parsing by another 30%! :)

Next week I'll focus on the reparsing bugs.
Uh, now that I think of it... Please submit them to Sourceforge! All the newfound bugs in CC need to be organized in the database.
« Last Edit: January 23, 2006, 07:30:30 am by rickg22 »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #5 on: January 23, 2006, 01:02:12 pm »
I removed a Mutex and replaced it with a critical section, maybe that'd do the trick with the lockup.
That's the same thing (well, for our purpose, it is), so that won't be the reason.
It rather looks as if there is no locking at all when entering the parse cycle. Apparently, two threads are concurrently modifying the same tree structure (which eventually freezes up).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #6 on: January 24, 2006, 04:38:06 am »
Thomas: I couldn't replicate the bug. I experience a brief delay, but did as you explained, and no hang / crash was detected.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #7 on: January 24, 2006, 10:50:47 am »
there must still be a bug in the codecompletion plugin ...

how to reproduce / what i've done:

1. create a workspace, which contains CodeBlocks and all Contrib-Plugins
2. open this workspace with CodeCompletion enabled, parse local & global includes,
    it lasts about 400sec to load and parse all projects and the memory-consumption is about 600MB !!! (->slow as molasses)
3. when i close the workspace, C::B crashes with a segmentation fault



--- for reference ---

4. open this workspace with CodeCompletion disabled, parse local & global includes,
    it lasts about 300sec to load and parse all projects and the memory-consumption is about 270MB
5. when i close the workspace, C::B doesn't crash

6. open this workspace with CodeCompletion disabled, parse local includes only,
    it lasts about 22sec to load and parse all projects and the memory-consumption is about 50MB
7. when i close the workspace, C::B doesn't crash


tested on a AMD XP 2800, 512MB RAM,
Windows XP, SP2
C::B SVN rev 1841
« Last Edit: January 24, 2006, 10:52:21 am by tiwag »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #8 on: January 24, 2006, 11:21:02 am »
Thomas: I couldn't replicate the bug.
When closing while reparsing in 1846, I get this from Dr.MinGW:
Code
DEBUG_EVENT:
dwDebugEventCode = CREATE_PROCESS_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 714
hProcess = 718
hThread = 798
lpBaseOfImage = 400000
dwDebugInfoFileOffset = 475000
nDebugInfoSize = 426C
lpThreadLocalBase = 7FFDD000
lpStartAddress = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = CREATE_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 220
hThread = 710
lpThreadLocalBase = 7FFDC000
lpStartAddress = 7C810856
DEBUG_EVENT:
dwDebugEventCode = CREATE_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 214
hThread = 70C
lpThreadLocalBase = 7FFDB000
lpStartAddress = 7C810856
DEBUG_EVENT:
dwDebugEventCode = CREATE_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 668
hThread = 708
lpThreadLocalBase = 7FFD9000
lpStartAddress = 7C810856
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 704
lpBaseOfDll = 7C910000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 700
lpBaseOfDll = 7C800000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6FC
lpBaseOfDll = 77BE0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6F8
lpBaseOfDll = 7C9D0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6F4
lpBaseOfDll = 77DA0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6F0
lpBaseOfDll = 77E50000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6EC
lpBaseOfDll = 77EF0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6E8
lpBaseOfDll = 77D10000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6E4
lpBaseOfDll = 77F40000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6E0
lpBaseOfDll = 10000000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6DC
lpBaseOfDll = 773A0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6D8
lpBaseOfDll = 76350000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6D4
lpBaseOfDll = 6FBC0000
dwDebugInfoFileOffset = 1A00
nDebugInfoSize = 19A
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6D0
lpBaseOfDll = 774B0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6CC
lpBaseOfDll = 770F0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6C8
lpBaseOfDll = 76AF0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6C4
lpBaseOfDll = 71A30000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6C0
lpBaseOfDll = 71A10000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6BC
lpBaseOfDll = 71A00000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6B8
lpBaseOfDll = 604C0000
dwDebugInfoFileOffset = BD4800
nDebugInfoSize = B0FB
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6B4
lpBaseOfDll = 8E0000
dwDebugInfoFileOffset = 3D8000
nDebugInfoSize = 2C8E
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6B0
lpBaseOfDll = 5D100000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6AC
lpBaseOfDll = 5B420000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6A8
lpBaseOfDll = 5B0F0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6A4
lpBaseOfDll = 13E0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 6A0
lpBaseOfDll = 76BB0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 69C
lpBaseOfDll = 77BD0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 698
lpBaseOfDll = 77660000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 694
lpBaseOfDll = 76F20000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 690
lpBaseOfDll = 71B70000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 68C
lpBaseOfDll = 1600000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 688
lpBaseOfDll = 76320000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 684
lpBaseOfDll = 20000000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 680
lpBaseOfDll = 4B4D0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 67C
lpBaseOfDll = 6FFC0000
dwDebugInfoFileOffset = 3C9800
nDebugInfoSize = 26C5
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 678
lpBaseOfDll = 1F90000
dwDebugInfoFileOffset = 244600
nDebugInfoSize = 2198
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 674
lpBaseOfDll = 69C00000
dwDebugInfoFileOffset = 21B000
nDebugInfoSize = 1D29
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 670
lpBaseOfDll = 64B80000
dwDebugInfoFileOffset = 61F400
nDebugInfoSize = 4E77
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 66C
lpBaseOfDll = 25E0000
dwDebugInfoFileOffset = 237400
nDebugInfoSize = 1F1E
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 668
lpBaseOfDll = 2830000
dwDebugInfoFileOffset = 3EAA00
nDebugInfoSize = 3C47
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 660
lpBaseOfDll = 2C30000
dwDebugInfoFileOffset = 18D000
nDebugInfoSize = 75B
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 65C
lpBaseOfDll = 67C40000
dwDebugInfoFileOffset = 333A00
nDebugInfoSize = 3635
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 658
lpBaseOfDll = 636C0000
dwDebugInfoFileOffset = 22BA00
nDebugInfoSize = 1E70
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 654
lpBaseOfDll = 2DD0000
dwDebugInfoFileOffset = 2B1200
nDebugInfoSize = 2622
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 650
lpBaseOfDll = 3090000
dwDebugInfoFileOffset = 3E5A00
nDebugInfoSize = 33EE
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 64C
lpBaseOfDll = 6DF40000
dwDebugInfoFileOffset = 253A00
nDebugInfoSize = 1ED7
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 648
lpBaseOfDll = 3480000
dwDebugInfoFileOffset = 27EA00
nDebugInfoSize = 2B8C
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 644
lpBaseOfDll = 6E500000
dwDebugInfoFileOffset = 236000
nDebugInfoSize = 1E06
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 640
lpBaseOfDll = 6A7C0000
dwDebugInfoFileOffset = 250A00
nDebugInfoSize = 2403
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 63C
lpBaseOfDll = 6C080000
dwDebugInfoFileOffset = D9E000
nDebugInfoSize = BE87
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 638
lpBaseOfDll = 3710000
dwDebugInfoFileOffset = 20EC00
nDebugInfoSize = 1683
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 634
lpBaseOfDll = 3AC0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 630
lpBaseOfDll = 76C50000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 62C
lpBaseOfDll = 59DD0000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = LOAD_DLL_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
hFile = 628
lpBaseOfDll = 77B10000
dwDebugInfoFileOffset = 0
nDebugInfoSize = 0
lpImageName = NULL
fUnicoded = 1
DEBUG_EVENT:
dwDebugEventCode = CREATE_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 218
hThread = 624
lpThreadLocalBase = 7FFDA000
lpStartAddress = 7C96077B
DEBUG_EVENT:
dwDebugEventCode = EXCEPTION_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 218
ExceptionCode = 80000003
ExceptionFlags = 0
ExceptionAddress = 7C911230
dwFirstChance = 1
DEBUG_EVENT:
dwDebugEventCode = EXCEPTION_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
ExceptionCode = C0000005
ExceptionFlags = 0
ExceptionAddress = 65662D20
dwFirstChance = 0
codeblocks.exe caused an Access Violation at location 65662d20 Reading from location 65662d20.

Registers:
eax=65662d20 ebx=01295f20 ecx=025450e4 edx=00000024 esi=105f3b80 edi=0022dc24
eip=00000000 esp=0022fff8 ebp=00000000 iopl=0         nv up ei pl nz ac po nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000216

Call stack:
AddrPC     AddrReturn AddrFrame  AddrStack  Params
00000000   00401240   0022FFF4   0022FFF8   00000000   78746341   00000020   00000001
00000000
DEBUG_EVENT:
dwDebugEventCode = EXIT_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 220
dwExitCode = C0000005
DEBUG_EVENT:
dwDebugEventCode = EXIT_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 478
dwExitCode = C0000005
DEBUG_EVENT:
dwDebugEventCode = EXIT_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 214
dwExitCode = C0000005
DEBUG_EVENT:
dwDebugEventCode = EXIT_THREAD_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 668
dwExitCode = C0000005
DEBUG_EVENT:
dwDebugEventCode = EXIT_PROCESS_DEBUG_EVENT
dwProcessId = 70C
dwThreadId = 218
dwExitCode = C0000005

When running Code::Blocks from the debugger, it points out a segfault in GetNoteBook(). It only ever happens when closing while reparsing after changing settings. Closing the application while it is parsing otherwise works fine.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #9 on: January 24, 2006, 03:18:45 pm »
I just tried up to step 2 of what tiwag said and got Code::Blocks to die even before it finished parsing all the projects:

Quote from: Code::Blocks Debug
[08:57:18.281]: Start parsing project Code::Blocks (wx2.6)
[08:57:18.281]: Concurrent threads for pool set to 2
[09:01:20.062]: Done parsing project copystrings (314 total parsed files, 22832 tokens in 239.781 seconds).
[09:01:31.265]: Done parsing project Code Stat (322 total parsed files, 23212 tokens in 11.203 seconds).
[09:01:31.265]: Updating class browser...
[09:01:31.281]: Class browser updated.
[09:01:32.765]: Done parsing project C::B KeyBinder (328 total parsed files, 24011 tokens in 1.500 seconds).
[09:01:33.656]: Done parsing project C::B Profiler (326 total parsed files, 23375 tokens in 0.891 seconds).
[09:01:39.921]: Done parsing project Help Plugin (wx2.6) (352 total parsed files, 25091 tokens in 6.265 seconds).
[09:01:52.203]: Done parsing project Exporter (362 total parsed files, 25283 tokens in 12.282 seconds).
[09:01:54.390]: Done parsing project Dev-C++ DevPak updater/installer (wx2.6) (375 total parsed files, 26298 tokens in 2.187 seconds).
[09:02:31.203]: Done parsing project wxSmith for wx 2.6 (575 total parsed files, 29055 tokens in 36.813 seconds).

Memory usage: 263.392 KB

Something I noticed is it takes 50% CPU while parsing half of the time. It goes like 50% for a few seconds then 0% for some seconds and again.

The reason it takes 50% and not 100% is 'cause my CPU has HT, even though it's supposed to be using 2 threads...

Another funny thing is the way it crashed. The "codeblocks.exe ha detectado un problema..." window is there just reporting it crashed, but I'm still able to "use" Code::Blocks. Really, I can click on menus, the project tree, but I just tried opening the Environment settings and it is finally unresponsive :P

Since I don't compile it with debugging information it's what I get:

Quote from: Dr. MinGW
codeblocks.exe caused an Access Violation at location 7c9206c3 in module ntdll.dll Writing to location 12fffffe.

The call stack is just 00000000.

Tested on an Intel P4 3.0E, 1GiB RAM,
Windows XP, SP2
Code::Blocks SVN revision 1833

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #10 on: January 24, 2006, 03:35:23 pm »
Quote
Another funny thing is the way it crashed. The "codeblocks.exe ha detectado un problema..." window is there just reporting it crashed, but I'm still able to "use" Code::Blocks.
That must be because Code::Blocks doesn't understand Spanish, so it wouldn't know ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #11 on: January 24, 2006, 04:46:52 pm »
Quote from: thomas
That must be because Code::Blocks doesn't understand Spanish, so it wouldn't know :wink:

:lol:

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #12 on: January 24, 2006, 05:31:50 pm »
:shock: Agh I'm such a fool! I used static events declaration for a part of the parser, no wonder it crashes! I need to use dynamic event tables! :oops:

Now, regarding the memory consumption, each token takes around 1K of memory usage. By summing the count of all tokens, i get around 247000 tokens, including the codeblocks.cbp (i used 73000 tokens which is what I get for global includes enabled). So the codecompletion tokens alone (without including the extra memory for data structures we end up using 256Megs, and this is because many tokens are duplicated among projects.

I think the whole model needs to be redesigned, it's obviously not fit for so many large projects at once... :(

I need another favor guys. What's the token count *WITHOUT* local or global includes?
« Last Edit: January 24, 2006, 05:35:25 pm by rickg22 »

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #13 on: January 24, 2006, 05:38:14 pm »
Hello,

I have checked the memory consumption of C::B (rev1846) with code completion all enabled. When I open C::B project, the memory's requirement increases up to 92-93 MB. Some time later (5-10 secondes, but I do not know exactly. Just the time to re-open this topic and press button "reply") the memory consumption falls to 5-6 MB and the project is opened.

May be storing the search trees in the disk instead of the memory would decrease the memory's requirement...

Michael

[EDIT] And here some more info (from Code::Blocks Debug):

Quote
Done parsing project Code::Blocks (wx2.6) (980 total parsed files, 60891 tokens in 2.394 seconds).

The parsing time seems low, but another try has given me  6.229 seconds.

And without all deselected:

Quote
Done parsing project Code::Blocks (wx2.6) (542 total parsed files, 15551 tokens in 3.495 seconds).
« Last Edit: January 24, 2006, 07:19:13 pm by Michael »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Codecompletion delays fixed in rev 1826 (update: in rev 1840)
« Reply #14 on: January 24, 2006, 05:54:36 pm »
CodeBlocks.cbp for rev1833 with follow local and global includes takes 77328 KB and stays there.

Quote from: Code::Blocks Debug
Done parsing project Code::Blocks (wx2.6) (982 total parsed files, 45558 tokens in 61.109 seconds).

Now without global includes it takes 51272 KB.

Quote from: Code::Blocks Debug
Done parsing project Code::Blocks (wx2.6) (542 total parsed files, 15540 tokens in 1.766 seconds).

With both global and local disabled it takes 51332 KB and has the same results about parsed files and tokens found.