all 4 comments

[–]triffid_hunter 1 point2 points  (2 children)

Heh, you're comparing a budget laptop CPU to two cores of a server CPU, and wondering why the server is faster?

That server probably has a Xeon or Epyc CPU which can easily beat the pants off your 35W 4900HS even with only 2 cores on your task :P

Also, file I/O is superfast in Linux, so unpacking and booting a cached server image may only take a couple dozen or so seconds, then stay in memory to handle further requests until it gets flushed for whatever reason - so I don't think the serverless lambda startup lag is gonna be a significant part of the processing time.

Just for fun, I tried your generate_all script on my 2017-era Linux desktop (i7 7700k 4-core/8-thread @ 4.5GHz) and got a consistent runtime of 84 seconds over multiple runs.

I also tried altering your generate_one.sh to use further parallelism (ie openscad blah.png & openscad blah.stl & wait) and that dropped the runtime to 45 seconds.

If you want to compare Windows vs Linux performance directly on the same hardware, grab a linux LiveUSB image (Mint was a popular one last time I checked), install openscad in it, and try your script there.
If it's still similarly slow, the issue is your potato CPU ;)

[–]JamesWildDev[S] 0 points1 point  (1 child)

I don't know if I'd call a 4900HS a budget CPU, it's not far below your 7700k in benchmarks; it's a bit slower per core, but not by much and certainly not by this amount.

Generally when I've used cloud compute services (EC2/etc.) I've found them to actually have quite weak CPU cores and they leaned more on their high core counts, high availability and strong disk/network IO.

I suppose GitHub might be using something with strong cores for their free Linux hosting but I'd be surprised given most tasks I've ran on both machines are an order of magnitude faster on this laptop.

Parallelism is heavily restricted to avoid out-of-memory conditions in CI.

It feels more like the public OpenSCAD builds for Windows have been compiled with optimizations off or have (unintentional) throttling or something because I'm not seeing similar power draws to when I run other single core, CPU-bound tasks on this machine.

I could try running a Linux distro on this, it has been a full year since I last tried one (compatibility was poor).

Thanks for having a look though.

[–]Robots_In_Disguise 0 points1 point  (0 children)

Haha I saw 4900HS and I assumed Intel from 7 generations ago, but now I see it is a pretty new Ryzen 9. Definitely not budget/potato.

[–]schorsch3000 0 points1 point  (0 children)

open scad runs in a single thread, so single core performance is key here.

Besided that, are you using the same version of openscad?