Recent Posts

Pages: 1 ... 5 6 7 8 9 [10]
91
Plugins development / Re: Code completion using LSP and clangd
« Last post by Pecan on June 26, 2024, 11:09:43 pm »
Hi Pecan,

compile_commands.json is read and parsed every time a file is opened. This uses a lot of CPU, especially during the initial parsing of all files, where
 compile_commands.json is read and parsed as many times as the number of files in the project. Attached patch does some optimisation for this.
1. Save the parsed compile_commands.json until the first batch parsing is completed, cleared after that.
2. After initial batch processing, all the filesnames are stored in a vector, and only if the filename is not present in this vector, compile commands is parsed. This helps to avoid parsing of the compile_commands.json after editing and saving of the file.

Thanks, Christo
Here some results from this christo patch.
The first millisecond measure following the filename is the parse time prior to the patch; the second is after applying the patch. There's a significant savings there. And it has a visible effect. It even feels faster.

Looks like I'll be applying the patch.
Thanks Christo.

Code
parser_base.cpp (1601 ms) (1264 ms)
codecompletion.cpp (2281 ms) (1776 ms)
LSP_tokenizer.cpp (1806 ms) (1235 ms)
parser.cpp (2462 ms) (1455 ms)
LSP_symbolsparser.cpp (2322 ms) (1706 ms)
coderefactoring.cpp (1744 ms) (1277 ms)
parsemanager.cpp (2274 ms) (1601 ms)
classbrowser.cpp (1723 ms) (1305 ms)
lspdiagresultslog.cpp (1253 ms) (524 ms)
ccoptionsdlg.cpp (1975 ms) (1554 ms)
ClangLocator.cpp (1295 ms) (1125 ms)
client.cpp (2417 ms) (1764 ms)
searchtree.cpp (596 ms) (329 ms)
cctreectrl.cpp (1983 ms) (1218 ms)
expression.cpp (2114 ms) (1238 ms)
token.cpp (1005 ms) (444 ms)
profiletimer.cpp (1983 ms) (251 ms)
ccdebuginfo.cpp (3174 ms) (1227 ms)
tokentree.cpp (2094 ms) (347 ms)
ccoptionsprjdlg.cpp (2878 ms) (1147 ms)
parsemanager_base.cpp (2345 ms) (410 ms)
selectincludefile.cpp (1791 ms) (395 ms)
doxygen_parser.cpp (3337 ms) (1299 ms)
StringUtils.cpp (491 ms) (346 ms)
gotofunctiondlg.cpp (1834 ms) (964 ms)
processreaderthread.cpp (1546 ms) (855 ms)
insertclassmethoddlg.cpp (2344 ms) (1155 ms)
procutils.cpp (1107 ms) (1078 ms)
winprocess_impl.cpp (1186 ms) (1076 ms)
winprocess.cpp (872 ms) (822 ms)
fileutils.cpp (1167 ms) (1219 ms)
asyncprocess.cpp (1755 ms) (1281 ms)


92
Plugins development / Re: Code completion using LSP and clangd
« Last post by stahta01 on June 26, 2024, 01:51:28 pm »
Oh yes, as sodev said, I just disabled wxUSE_UNSAFE_WXSTRING_CONV. Those STL containers related options have been modified, too, but I don't think they really influence the conversion from wxString to std::string.

Since, IIRC, using STL means wxString is stored as std::string I would say you are technically right but, if the other person is using an STL built wxWidgets and you are not then you could have that as the cause of your problem!

Tim S.
93
Plugins development / Re: Code completion using LSP and clangd
« Last post by Grit Clef on June 26, 2024, 04:41:00 am »
Oh yes, as sodev said, I just disabled wxUSE_UNSAFE_WXSTRING_CONV. Those STL containers related options have been modified, too, but I don't think they really influence the conversion from wxString to std::string.
94
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by stahta01 on June 26, 2024, 02:08:07 am »
Projects can depend on other projects with the info stored in a workspace.
Targets in a project can depend on external files with the info stored in the project file.

Tim S.
95
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by Sephiroth on June 25, 2024, 07:52:51 pm »
Okay, I think I see what that does, I am just used to a way that seems more logical. You'd create a project in MSVS and add all sub-projects. You could go into the master project and specify the build order of the sub-projects, whether or not they depended on each other. I am assuming this is not possible in CodeBlocks and that is why you are telling me to do the dependencies the way that you did. I was expecting something like MSVS and Borland, or even a few others I used in the past.
96
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by cacb on June 25, 2024, 07:38:38 pm »
It is just a build order dependency. There is no automatic library linking or anything like that.

The workspace is not a project, it is a workspace containing projects and declaring possible project build dependencies. If you insist you could create a dummy project doing nothing but declaring dependency on projectA and ProjectB. But what I said does the same thing. 
97
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by Sephiroth on June 25, 2024, 07:25:38 pm »
So in MSVS the master project would depend on project A and B in your example. It checks A and builds if needed, then it does the same for B. There's no way to do this in CodeBlocks? Making one project depend on another when it really does not WILL confuse me down the road. If I step away for a while and come back to it this strange chaining of dependencies will be a hold-up. Is there any way to make the master project check and build each sub-project one at a time?
98
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by cacb on June 25, 2024, 07:09:32 pm »
Create a Code::Blocks workspace with multiple projects using same name build targets.

workspace-folder  (contains MyProjects.workspace)
       |
      +- projectA-folder   (contains projectA.cbp)
       |
      +- projectB-folder   (contains projectB.cbp)

Select "Properties" on ProjectB and go to "Project Dependencies..." at the bottom.
Declare ProjectB to depend on ProjectA. This info will be saved in the MyProjects.workspace file only.

When you build ProjectB , then projectA will be checked for necessary build first.
99
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by Miguel Gimenez on June 25, 2024, 07:05:27 pm »
Read again my post, I am talking about two targets in one project.

Multiple projects can be joined in a workspace, but the target approach is better.
100
Using Code::Blocks / Re: Project dependent upon another project?
« Last post by Sephiroth on June 25, 2024, 06:59:43 pm »
Can you go into detail a bit? I can easily create individual projects but have NEVER tried anything involving multiple projects in CodeBlocks. Also, why do I need a virtual project if there is a real project targeting both?
Pages: 1 ... 5 6 7 8 9 [10]