Working while compiling?

Currently on Windows 11.

I have a large project that benefits from aggressive compiler optimization, it has been compiling for over 12 hours now. That part is fine, I can wait for it.

However, this keeps Xojo tied up and I’m not able to work on or debug other applications in other Xojo windows at the same time. My other Xojo IDE windows technically respond, but they are incredibly slow. Like, click on something and wait 20 seconds for the click to register. And I’m not able to debug them, clicking the “Run” button has no effect, probably because the compiler is already in use.

Is there any workaround? I would love to be able to lower the process priority of the compile and keep working. I have 128 GB of RAM and plenty of CPU overhead so the system can definitely handle it.

Continue to work on a second machine…

Probably this bug: https://tracker.xojo.com/xojoinc/xojo/-/work_items/77604#note_585368

If you can rework your code to reduce or change how you use Variants you might be able to get the compilation time back to normal.

Unfortunately I’m in a hotel room with just a laptop, so there is no other computer to use.

Also unfortunately I’m using compiled third-party libraries that deliver variants to me so there’s not much I can do to rework that.

But I appreciate the replies.

If you were on a Mac I’d probably do this:

  1. Duplicate your Xojo folder so that you have a second copy of Xojo to run.
  2. Run and compile using your original Xojo folder.
  3. Use AppTamer to slow down/limit the processor usage of Xojo in #2.
  4. Run Xojo from #1 to continue working on something else.

For a PC though #1 is different. After a quick GPT chat, apparently it’s even easier:

The easiest Windows equivalent

Launch Xojo normally, then Shift-click its taskbar icon.

Microsoft explicitly documents:

Shift + select an app icon on the taskbar → Open another instance of the app.

So with Xojo:

  1. Launch Xojo.
  2. Open the project you’re working on.
  3. Hold Shift and click the Xojo taskbar icon.
  4. A second Xojo.exe process should launch.
  5. Open the second project there.

For #3, I’ve never used it, but it looks like Process Lasso might be the equivalent to MacTamer on Windows.

All untested here and just my thoughts off the cuff so no guarantees any of this will work. But it’s probably worth a shot.

How about a Virtual Machine - you could easily spin up a second VM on your machine, and limit the # of virtual CPUs so that it wouldn’t hog all of your processing power.

We didn’t figure out exactly what causes the slowdown - the answer doesn’t seem to be “Don’t use variants at all” but rather “Don’t use variants in a particular way” - there are some code examples in the Issue you could look at.

If you are lucky, it could be one Function or Method which is causing the entire slowdown, and if you could find and fix it, compilation speed would return to normal..

Windows or Mac?
For these cases I always have at least 2 Xojo Versions (original and copy of the release) in use.
Most of the time there is also a 3rd Version - the latest Beta.
If one of them is compiling or running, the other ones work totally fine.

Our ultimate goal (which is on the roadmap) is a command line compiler that can be quietly compiling in the background so that by the time you hit Run or Build, it’s likely already finished.

And FWIW, every time you renew your license, you’re contributing to us reaching that goal. :slight_smile:

Does this work with ChatGPT/Codex? Also how do you manage the huge amounts of memory that Xojo needs?

So it would compile anything unchanged in the background so that all you end up waiting on is for newly-changed items to compile? Someone’s been using their whole brain over there at your office.

That’s the idea, yes. And given how much of the time we are staring at our code, it may have nothing left to compile by the time you press run or build, just linking. We can’t do that in advance.

This is a feature I requested about 9 years ago (https://tracker.xojo.com/xojoinc/xojo/-/work_items/48393) as in theory, the IDE could also notify you about warnings and errors inline like Xcode does.

I spent nearly an hour just staring at code while thinking through a process right before seeing your answer. :bullseye:

I have the same problem with a large project;
I reported it via the tracker I sent to support,
and they tested it and reproduced the issue.
It’s been confirmed as a bug, but I’m still waiting for a definitive answer…
Try joining my tracker entry maybe that will help.

https://tracker.xojo.com/xojoinc/xojo/-/work_items/81328

I don’t have Codex connected with Xojo. I still let Codex work and then reload the items in the IDE.

RAM is enough … at least I don’t have any performance issues:

I personally would have preferred that the IDE became responsive as a whole rather than going to a solution involving the command line, which I rarely use (and normally dislike and avoid).
Sorry for being pessimistic.

If the compiler was a separate command-line application, the IDE would shell to it asynchronously and would remain responsive since the heavy lifting is done in a completely different process. We also would be able to write our own compilation scripts, run regular automated compiles on a schedule, etc. It would be quite nice.

Granted, if the new command-line implementation isn’t just for the users but the IDE also uses it, it would certainly be a huge improvement.
It remains to be seen.

What I find shocking is, that XOJO takes 12h+ for his project to compile! Command line compiler will change that not much - I fear.

His Windows laptop with 128GB RAM - which is really , really much for an laptop - even for an Desktop PC will have also a fast, newer Intel Mobile CPU - in such case of 128 GB RAM.
I would accept such long times for an 16 GB with older Intel Mobile from before 2020, but with 128 GB RAM and new fast cpu?!

I must be doing something different. Even on my 32 GB iMac I have to restart now and then. On my old 8 GB MacBook Air I get “computer ran out of memory” and then I see Xojo with 30 or 40 GB.

I did a release yesterday with another Xojo version so the 12 GB is from one single day: