News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

Slow compile times

Started by kcsl, Mar 17, 2025, 10:48 AM

Previous topic - Next topic

kcsl

The program I'm working on is getting rather large, and as a consequence the compile process has gotten longer, actually the compile is pretty quick it's the assembly pass that seems to be slow. I'd already switched off optimisation and that had helped, but it was starting to get annoyingly slow again. Anyway, I added an exclusion to Malwarebytes to not scan my c:\Development\PIC folder which is where my source code and more importantly the compile/assembly process creates all it's intermediatory and output files, and this has slashed the compile cycle time.

Regards,
Joe


There's no room for optimism in software or hardware engineering.

ricardourio

#1
Hi Joe,

   Just to compare, I have a program occupying 99.38% of a 18F87K22 (128K) and it takes 69.4 seconds to compile. The computer is pretty old Core i5-3570 3.40GHz with 16 GB RAM.

Ricardo Urio

kcsl

Interesting.
I'm using an 18F27Q83 (128K).
On my original XEON development PC, when the program was around 25% it was taking 90+ seconds. I realised I couldn't carry on with that PC hardware.
(It was a pretty old PC).

I've now moved to a new system (AMD Ryzen 7-7700 @ 3.8GHz) and with my program at 91% it was taking around 45 seconds, then adding the Malwarebytes exclude reduced that down to 33 seconds.

Joe





There's no room for optimism in software or hardware engineering.

trastikata

Hello Joe,

very relevant topic, thanks for bringing this up, I am considering too changing the old 15 years old PC.

I use the PC only for PCB design, Positron programming, Visual Studio and web browsing, any advice what kind of CPU benchmark test comparison shall I look at when choosing the right value CPU?

kcsl

Hi Trastikata,
I'm not a PC expert so I spent a lot of time with ChatGPT and it did a pretty good job on it's recommendations. I gave it a list of the activities that I want the machine for (basically the same as your requirements) and a budget price. When I eventually got a spec together and spoke to a PC supply company that also do custom builds, they pretty much agreed with ChatGPT's suggestion; other than a different chassis which ended up a bit cheaper.

What I think is correct is that Positron isn't multi-threaded, so you won't really benefit from lots of CPU cores.
What you do benefit from are fast cores, fast RAM and excluding any anti virus packages from scanning the folder where the compilation takes place.
ChatGPT also warned me off getting a top-end GPU card as I don't play games but I did want support for multiple-monitors; the main one being 5120x1440 and it suggested I save money on the GPU and spend it on a better motherboard, high spec RAM and a decent PSU.

I've just run a compile on my work PC. It's a pretty old i7-7700K @ 4.2GHz with 32Gb RAM and 512Gb SSD - 125 seconds for a 30K program. Switching off the anti-virus package brought that down to 30 seconds. My new machine wipes the floor with this this one though.

This is the spec we eventually settled on:

Fractal Design Define 7 Compact chassis (not with clear sides as more expensive apparently).
ASUS TUF GAMING B650-PLUS WIFI - PCIe 4.0, 3x M.2, 2.5GbE/WIFI 6, 6x USB-A. 2x USB-C
AMD Ryzen 7 7700, Zen 4, 8 Cores, 16 Threads, 3.8GHz, 5.3GHz Turbo, 65W
Be quiet! Pure Rock Slim 2 - Air Cooler, 130W TDP
32GB (2x16GB) Corsair Vengeance 6000MHz (leaving 2 memory slots free for later expansion if needed).
4GB NVIDIA A400, 768 CUDA Cores, Supports 4 Displays (4x mDP) (currently running my large 5120x1440 and 2 x 1920x1080 monitors with no issues).
Corsair RM850e, 80PLUS GOLD, ATX 3.1, Fully Modular, Zero-Fan Mode
1TB Samsung 990 PRO NVMe PCIe 4.0, 7450MB/s Read, 6900MB/s Write, 1200K IOPS
Microsoft Windows 11 Pro 64-Bit

Initially I'd suggested internal RAID as I've usually gone for that on my development machines but it warned me off eventually saying:

Quote:
Final Verdict: RAID Isn't Necessary for Your Build
✔ Your system is already crazy fast with a Samsung 990 Pro NVMe SSD. RAID wouldn't have noticeably helped for dev work.
✔ RAID 0 (striping) could have boosted large file transfers, but at the cost of reliability. (either disk fails and you lose everything)
✔ RAID 1 (mirroring) would have added redundancy, but you already back up to your NAS & write speeds slower as need to be duplicated.
✔ RAID 5/6 is pointless unless you have 3+ drives and want parity-based redundancy.

For your needs, a single high-speed NVMe drive was the right choice—you get maximum speed with no RAID complexity or risk

I did ask if budget wasn't a consideration what would it have chosen and the big item was the CPU:
Quote:
In summary, transitioning to the Ryzen 7 9800X3D would provide measurable performance enhancements in both single and multi-threaded tasks pertinent to your projects. However, it's crucial to balance these benefits against factors like increased power consumption and cost to ensure the upgrade aligns with your overall objectives.

I asked it to guesstimate the performance enhancement, cost and power requirements, and it came back with a figure of %15, an additional £200 and double the power requirements.

Regards,
Joe
There's no room for optimism in software or hardware engineering.

LeonJ

Some feedback on speed and new PC:

I had the same experience with slow compiling and especially assembly on an older PC.
I upgraded to a new modern PC (similar to Joe) and after some tweaking with clocks and memory access it improved speed significantly.

Because I have older legacy projects and software, I installed Oracle Virtual Box and Windows XP (inside VirtualBox) with no anti virus stuff in XP.

As a test, I installed Positron in the XP VM as well.

To my surprise, Positron compiles and assembles almost twice as fast as the main Windows-10 machine.

If I recall correctly (for a large program on a 128k device)
Old XP PC: 46 seconds
New W10 PC: 11 seconds
New XP VM (on New W10): 5 seconds
Happiness!

Leon

LeonJ

Thought I should share this also:

NEW MONITOR:
At 66, my eyes are straining a bit with coding all day. I got a LG Dual-Up monitor (LG 28MQ780-B 28 Inch SDQHD (2560 x 2880) Nano IPS DualUp Monitor with Ergo Stand) which has an unusual 16:18 aspect ratio. It's taller than what its wide. I use it as a single display (not split as 2 displays).

This allows for more text lines top-down with larger font size (up to 80 lines for my font size of 13 pt). After 4 months of using it now, I can never go back to any other monitor. It has reduced eye stress and improved my coding time endurance significantly. It is pricey but definitely worth it for me.

FLASHING CHIPS:
I found the PickitMinus with Pickit3 the fastest flashing tool combo so far. PickitPlus also works well but its slower. MPLABX's IPE is useless for me.

So with the much faster compiling, fast flashing, great monitor and fantastic Positron compiler (thanks Les!), I'm enjoying coding more than ever.

Leon.

Stephen Moss

#7
Quote from: LeonJ on Mar 19, 2025, 08:16 AMThis allows for more text lines top-down with larger font size (up to 80 lines for my font size of 13 pt). After 4 months of using it now, I can never go back to any other monitor. It has reduced eye stress and improved my coding time endurance significantly. It is pricey but definitely worth it for me.
At work I noticed one person had a screen of what looked like code but they had turned their screen 90 degrees, perhaps having the screen orientated in portrait mode also results in the font displaying a little larger. Although I am unsure how you would tell the PC you have it oriented that way.
If you don't use dark mode also try that for reducing eye fatigue as well, I find the black background much better than a bright white one for my eyes.

Quote from: trastikata on Mar 17, 2025, 10:26 PMI use the PC only for PCB design, Positron programming, Visual Studio and web browsing
If an old PC means you are also using an old version of Visual Studio you might find you need to make changes if your new PC means using the latest version, I am having to update all the software I have written I seems it will no longer load anything targeted at 32-bit and/or less than .Net 6 and other issues. 

top204

#8
Since windows 8, they are extremely slow operating systems, and windows 10 and 11 are truly dreadful for speed (and almost everything else)!

I could not believe the speed difference when I updated my wife's laptop with windows 10! It ran several times slower than the windows 7 that it had originally, so I placed windows 7 back on it.

I use virtual machines for compiling and other things, because the virus checks and other things are more like virus' themselves and slow things down, and delete things for no real reason, except a "best guess" etc...

I always browse in a virtual machine with virus checking etc, and scan programs in a virtual machine with a couple of virus scanners on it, but I never work in a system with all the gubbins enabled, because it runs so, dreadfully, slowly, and the operating system cannot be trusted.

Bring back the days where speed was of the essence, and on small computers, incredible things could be accomplished because there was true creativity and learning. In the UK, we had a saying for the need for more, and faster, hardware all the time. "The american way" :-) Sorry to my USA friends, but since the PC generation, and especially since the windows O/S, if more speed was needed, why bother working on code, or learning code in detail, when you could just add more to the machine, and then more and then more, to make the corporates richer for no actual reason! :-)

Just look at the more popular languages now? All interpreted or bloated, and sloooooooooow. Just like the early 1980s, before the true programmers had, had enough of interpreted languages and studied the machines and their, 'usually limited', hardware, and made them do incredible things.

Frizie

Windows 8 ... 11 (I surf the internet with a desktop PC running on Windows 11) are indeed disgustingly bad  >:(
My older laptop runs offline under Windows 7 and has no virus scanner.
Compiling is quite fast and this Windows version just works much nicer.  :D

The disadvantage is that I cannot do updates of Positron directly but always via a USB stick  ::)
As long as I have no problems with PIC programming I do not update Positron.

Another disadvantage of Windows 7 is that I cannot use the nice VSC (Atomix), because the newer versions cannot be installed on Windows 7  :(
Ohm sweet Ohm | www.picbasic.nl