Welcome, Guest
Username: Password: Remember me
Hier wird Deutsch gesprochen
  • Page:
  • 1
  • 2

TOPIC:

Compiler Laufzeit 01 Feb 2022 14:12 #21337

  • Chris
  • Chris's Avatar


  • Posts: 3404
  • Hi Kai,

    Sorry, my previous reply was out of sync! Replying to this post now:

    Kai wrote: The .exe depends on a large . DLL with another 12945 entities and another 1000 constants. I added a screenshot to the attachments. It is interesting that the .dll file compiles in about 5 minutes, which is still far from a minute or less, but is significantly faster than 25 minutes of the .exe file.

    Many of the constants from the .dll-file are used in the .exe file and are not redefined separately in the exe file's project. Could this be a problem because the compiler needs to find the constants in an external dll-file?


    1000 constants should not be a problem. But what do you mean by constants, DEFINEs if I understand correctly?

    Do you have a smaller library that you could send (if it''s not possible to send this large one)? Maybe a 50,000 or 100,000 line or so library that is ok to send, so we can try it in our machines and compare the compiling time in our machines, compared to yours? Just to make sure if it's something hardware related or it is a problem in the compiler.

    Btw, so you are managing an app with close to a million lines of code in XIDE, that's nice to see!
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    Compiler Laufzeit 01 Feb 2022 14:34 #21338

    • Kai
    • Kai's Avatar
    • Topic Author


  • Posts: 10
  • Hi Chris!

    I sent you an Email with some 100000 Lines of code at

    The DLL file depends on some other DLL files. So a few more lines of code. :-)

    Kai

    Kai

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 01 Feb 2022 17:53 #21343

    • Chris
    • Chris's Avatar


  • Posts: 3404
  • Hi Kai,

    Thanks for the files! This library actually consists of 270,000 lines (although a big portion is comments), and the time it takes to compile in my machines is....you will not believe it....7 seconds!!!

    At first I thought there is some error and maybe some source files are being ignored by the compiler, but checked and re checked, the compiled dll seems good. This is with the subscribers version of the compiler, I will install back the public version to check also with it just in case, but I can't believe this will take more than 20 seconds either.

    Can you please check the Performance tab of the Task Manager in your PC before hitting Compile? What's the % usage for the CPU, RAM and disk? If the CPU is already being used, or free memory is already very low, this could explain the very slow compiling times. Could it be there's an antivirus program eating up a lot of resources at the same time?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 01 Feb 2022 18:12 #21344

    • ic2
    • ic2's Avatar


  • Posts: 1424
  • Hello Chris,

    Chris wrote: and the time it takes to compile in my machines is....you will not believe it....7 seconds!!!


    This is so fast that, anticipating on it, no doubt, Hollywood made a movie about it and Yousso N'Dour a song,
    open.spotify.com/track/76D5nfZbYzZYfUZKGy73jy
    www.imdb.com/title/tt0417395/

    But that makes me wonder why Frank's brand new latest generation i7 Pc, with plenty of memory, fast SSD etc, still requires a full minute to compile the last program. It goes pretty quickly through the first 16 libs and then the rest of the time it is either busy with the last (largest) program or finishing up.

    Dick

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 01 Feb 2022 18:12 #21345

    • Kai
    • Kai's Avatar
    • Topic Author


  • Posts: 10
  • Hi Chris!

    7 Seconds?? Incredible! Before I start compiling CPU is between 3 und 5 percent, RAM between 30 and 35 percent and Disk at 2 percent.
    I think before we invest more work I try another computer. Maybe the antivirus programm or something else produces these problems.

    Kai

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 01 Feb 2022 18:30 #21347

    • Chris
    • Chris's Avatar


  • Posts: 3404
  • Hi Dick,

    ic2 wrote: But that makes me wonder why Frank's brand new latest generation i7 Pc, with plenty of memory, fast SSD etc, still requires a full minute to compile the last program. It goes pretty quickly through the first 16 libs and then the rest of the time it is either busy with the last (largest) program or finishing up.


    Some of this time at least could be the overhead of MSBuild, which VS is always using when you compile your app/project/solution (XIDE calls the compiler directly). I have no idea what MSBuild does and is so slow, but in many cases I have noticed that it adds so much overhead before/after actually compiling that some times it is actually taking more time than the time needs to compile the code itself. You need to watch the output window while building, to see what is the actual time the X# compiler itself takes.

    Or it could also be due to the specifics of the code of this project. This is why I asked Kai to send some of his code, it was very possible that something specific in it was causing the delay, because the compiler did not expect it. As it turned out, in this particular case there was no such problem, but it's possible there's some bottle neck with your code. Btw, what's the size of this project of yours in lines or kb?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 01 Feb 2022 18:45 #21348

    • Chris
    • Chris's Avatar


  • Posts: 3404
  • Hi Kai,

    Kai wrote:
    7 Seconds?? Incredible! Before I start compiling CPU is between 3 und 5 percent, RAM between 30 and 35 percent and Disk at 2 percent.
    I think before we invest more work I try another computer. Maybe the antivirus programm or something else produces these problems.


    I think that's the case. I just tried also with the public version just released (2.10): At the first time, it took 24 seconds to compile the library. At the second time and next ones, since the compiler process has now already initialized everything, it is taking 18 seconds each time.

    Tested on i5-8400 @ 2.8GHz (6 cores), 8 GB RAM, SSD disk.
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 12:17 #21549

    • hilberg.it
    • hilberg.it's Avatar


  • Posts: 57
  • Hi,
    since X# 2.10 compile time decreased significantly! I am using Visual Studio 2019. Did anyone experience similar behavior?

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 14:38 #21550

    • robert
    • robert's Avatar


  • Posts: 2974
  • "Compile time decreased".
    What do you mean?
    Is is faster or slower ?

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 15:03 #21551

    • hilberg.it
    • hilberg.it's Avatar


  • Posts: 57
  • Sorry. I mean slower. I need to restart Visual Studio quite often. Don't know why this is happening now.

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 15:34 #21552

    • Chris
    • Chris's Avatar


  • Posts: 3404
  • Why do you need to restart VS, does that help with comping speed? Or is this a different problem? Or do you mean that it's VS that has become slow and not the compiler? If it's VS that is slow, does it happen while editing, is it slow when typing, when showing member lists, or maybe in some other circumstances?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 16:26 #21553

    • hilberg.it
    • hilberg.it's Avatar


  • Posts: 57
  • This is what I have noticed: I am compiling a rather large project and I need to wait some seconds for it to compile. Then I am making small changes in a large file (19k LOC in that file) and re-compiling. It works for some iterations, but after A while VS hangs in compilation phase and takes 10-20minutes to finish compilation. That is when I cancel and restart VS. I don't know what is causing this. My guess would be that the file is too big. But I thought that this problem occurred after the last update. Correct me if I am wrong.

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 16:45 #21554

    • ic2
    • ic2's Avatar


  • Posts: 1424
  • Hello Chris, Robert,

    When I change something in a lib which is used in other libs and I compile that lib it compiles in VO in a second or so. Then I see a couple of red dots in those libs and main programs. I right click on each of them to compile and about 10 seconds later I am good to go.

    The converted VO project is 14 libraries and 1 (big) main program. You almost always need to recompile everything to be able to start the program and you see the counter slowly going up. It takes some extra time to finish, that could be MSBuild. I'd estimate that it counts to 14 in 40 seconds and 15 is another 20.

    When Frank starts the program it again shows some Build messages, something I'd say it just finished doing. Why?

    Bottom line is that every small change can only be tested in >1 minute while that would cost 2 to 10 seconds in VO, depending where the change is situated in VO. That could easily add 1 hour of waiting time a day compared to VO.

    Can't we do something to bring that time back, besides creating a DLL for each lib and maintain it in separate solutions?

    Dick

    Please Log in or Create an account to join the conversation.

    Last edit: by ic2.

    Compiler Laufzeit 14 Feb 2022 17:30 #21557

    • Chris
    • Chris's Avatar


  • Posts: 3404
  • hilberg.it wrote: This is what I have noticed: I am compiling a rather large project and I need to wait some seconds for it to compile. Then I am making small changes in a large file (19k LOC in that file) and re-compiling. It works for some iterations, but after A while VS hangs in compilation phase and takes 10-20minutes to finish compilation. That is when I cancel and restart VS. I don't know what is causing this. My guess would be that the file is too big. But I thought that this problem occurred after the last update. Correct me if I am wrong.


    During those 10-20 minutes, can you type in the VS editor? If not, I guess this is a different problem, because the compiler process and Visual Studio are completely separated, a slow compiling should not cause any slowness in VS.

    What could make a difference (if it's not a bug in the X# VS integration) though, is if there's not enough available memory and the compiler eats even more, causing then all sorts of problems to the OS. Can you please check when there is this freeze, how much memory is available? And also if there are other programs using extensively the CPU or disk?

    .
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 14 Feb 2022 17:54 #21558

    • robert
    • robert's Avatar


  • Posts: 2974
  • Dick,

    ic2 wrote:
    When I change something in a lib which is used in other libs and I compile that lib it compiles in VO in a second or so. Then I see a couple of red dots in those libs and main programs. I right click on each of them to compile and about 10 seconds later I am good to go.

    The converted VO project is 14 libraries and 1 (big) main program. You almost always need to recompile everything to be able to start the program and you see the counter slowly going up. It takes some extra time to finish, that could be MSBuild. I'd estimate that it counts to 14 in 40 seconds and 15 is another 20.

    When Frank starts the program it again shows some Build messages, something I'd say it just finished doing. Why?

    Bottom line is that every small change can only be tested in >1 minute while that would cost 2 to 10 seconds in VO, depending where the change is situated in VO. That could easily add 1 hour of waiting time a day compared to VO.

    Can't we do something to bring that time back, besides creating a DLL for each lib and maintain it in separate solutions?


    This is not related to the problem that hilberg.it reported.

    What you can do to get faster compilation times is to configure Visual Studio to NOT recompile everything, but only the library that was changed.
    (Btw: this only works if you are not changing the prototypes of functions/methods and if you are only changing the code inside a function/method)

    To do so you need to configure your solution in a special way:
    - Make sure that your DLLs have a "fixed" version number (so do not use the "*" character in the version)
    - Make sure that all DLLs and the EXE have the same output folder (something like $(Solutiondir)\Debug)
    - Goto the Build/Configuration manager and remove the checkboxes for the libraries that you do NOT want to be recompiled
    - Then apply the change in the DLL and build only that DLL (with Build-Build Selection.
    The shortcut for this can be Shift-F^ but may also be different depending on the settings that you have chosen when you started VS for the first time
    - Then run the app with Ctrl-F5 or debug the app with F5.
    - If you have to compile more than one library you can also select them in the Solution Explorer and build from the context menu.

    I know that this is still not as fast as VO, but there is not much we can do about this I am afraid.

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 16 Feb 2022 10:11 #21566

    • FdeRaadt
    • FdeRaadt's Avatar


  • Posts: 24
  • Deselecting Libraries decreases the time the compiler takes, but not by a lot. I can compile my project in 40 seconds instead of a minute now. It is not a lot, but it helps.

    I think it is going to be a common practice for me to deselect libraries that don't need to be recompiled.

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 16 Feb 2022 10:40 #21567

    • Frank Müßner
    • Frank Müßner's Avatar


  • Posts: 251
  • Hello X#Team,
    maybe a hint to solve the problem.
    I first installed 2.10 on a system to test it. At first everything worked, at some point I wanted to do a global text replacement. Certainly more than 100 words would have had to be replaced. When the replace was started, it appeared to compile immediately after the first replace. The number of errors kept changing.
    I then had to cancel the replacement after 10 minutes and then ran it again in 2.9#. Didn't last a second.

    Frank

    Please Log in or Create an account to join the conversation.

    Compiler Laufzeit 16 Feb 2022 14:50 #21570

    • hilberg.it
    • hilberg.it's Avatar


  • Posts: 57
  • Chris wrote: During those 10-20 minutes, can you type in the VS editor? If not, I guess this is a different problem, because the compiler process and Visual Studio are completely separated, a slow compiling should not cause any slowness in VS.

    What could make a difference (if it's not a bug in the X# VS integration) though, is if there's not enough available memory and the compiler eats even more, causing then all sorts of problems to the OS. Can you please check when there is this freeze, how much memory is available? And also if there are other programs using extensively the CPU or disk?


    I notice that VS slows down a lot lately. Don't know what exactly is causing this. CPU/RAM seems to be fine. I can click in VS, but it lacks. I see this banner "We've noticed that extension 'XSharp Visual Studio Project System' is slowing typing performance." Hope that helps.

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1
    • 2
    Moderators: wriedmann