[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 0776446788.jpg (439 KB, 850x850)
439 KB JPG
has anyone ever tried to calculate the performance losses incurred by having a program run on top of an OS instead of on bare metal?
>>
It would actually be a performance gain since OSes allow proper multitasking.
>>
File: 1693764537491280.png (170 KB, 384x419)
170 KB PNG
>>108843195
No because you can't run the same program inside an OS and on bare metal. This is not the same thing as cross-platform programs because even those rely on a common syscall interface, but with bare metal you don't have a syscall interface because YOU are the OS.
>>
File: 1601371040558.png (315 KB, 507x693)
315 KB PNG
>>108843195
>>108843525
TempleOS got the closest to this (still a OS but ring 0 no virtual memory and single address space) and the difference was huge in context switches per second for example, wouldn't be too surprising if lot of other things were faster.
But really the question should not be "would it be better without the os" but more like "can we made radically different os from what we have" and "do we need general purpose os for everthing"?
>>
>>108843195
Yes, check Doom 3 on OG Xbox (bare metal) vs a similar PC (Pentium 3 733 Mhz, 64MB V+RAM, GeForce 3-tier)
hint: it can't run on the PC
That should give you an idea
>>
>>108843195
Why would you even assume it is not common to calculate that make decisions based on results?
It is something people actually do when they decide between Linux, RTOS or some libs maybe, if they don't need any OS at all.
>>108843267
It's not always needed.
>>
File: mips the rabbit.png (22 KB, 161x188)
22 KB PNG
Yes. Old game consoles especially.
>>
>>108843892
Has anyone really been far as decided to use even go want to do look more like?
>>
Somewhat related is security. With or without an OS.
It's insane and frustrating how simple and fast software can be if you do not care about security. Every bit of it is complex mathematics to intentionally obscure and that comes at a cost both to execute and to write (correctly). Combine this with registries of credentials and capabilities etc. you now need whole systems running all the time and coordinating and none of this actually has to do with your program in principle, it's just there because people can't be trusted and no other reason.
>>
read stories for software like bc running without os, calculations are like from 1960s
>>
>>108843525
but there must be SOME way to quantify the losses
>>
>>108843195
Sure. Anyone working on mainframes. So IBM for sure. Maybe oracle too
>>
>>108843195
>>108847011
The losses are, in effect :
>context switching(saving registers, once per thread switch, happens whenever the thread's allocated time quantum has elapsed or the program does a yield() call)
>other threads competing for L3 cache space and bandwidth, RAM bandwidth and pollution of bank switching(yes, that RGB software waking up and using the CPU even for 10000nanosecs has a difficult to amortize cost despite DDR5 being built to handle simultaneous RW)
>(multithread CPUs)threads competing for CPU core register file(some CPU designs statically or dynamically allocate core resources) and execution ports(this is particularly bad if they compete for fpu ports, even if any execution port being used could reduce performance)
This is why the potentially only correct way to remove potential stutters in videogames is to have the game threads hog the correct cores and let the rest occupy so called estrogen cores/X3Dless CCD/least good CCD or the 2nd logical cores of all cores, at least you reduce context switching bullshit to a minimum
This is also why latency trannies who believe in the "AMDip" boogeyman recommend using windows registry "fixes" to change threading to enforce longer thread allocated time(quantum), not realizing it may backfire if the RGB or chromium pisscord software hogs a core for longer than it would have without that "fix"
>>
>>108843773
Xbox has a windows based OS. It isn't running software on bare metal.
>>
>>108843894
Mario 64 uses a different thread for audio
There is still a thread context switch overhead, the only clue why they did it this way i have is that the early dev was done on the SGI workstations which do use MIPS hardware and do actively run an OS, perhaps it made sense because the N64 CPU is MIPS too and has the threading functionality anyway
No idea about PS1 and DC however
>>
File: r-chamber.jpg (458 KB, 1244x750)
458 KB JPG
0 aka no losses

what OS does program will do, so program will become the OS and do the same thing, thus, calculated.
>>
File: PSP pedestal.jpg (64 KB, 666x700)
64 KB JPG
>>108847129
You're right but I just meant game consoles and game devs of the time specifically knew the benefits of running bare or making their own micro OS more similar to a BIOS on some even older machines.

In the case of SM64 the devs did the best they could at the time with limited experience of the new platform, 3D graphics, tools, etc.

A guy named Kaze is hyper optimizing the SM64 decomp to absurd degrees and highlights a lot of the mistakes and flaws the original team made.
Not to discredit their work, but it further pushes the point of performance when you decide to target a very specific machine without an OS rather than trying to abstract the hardware in some way.

His custom game built on the same hardware looks like a GameCube game and runs at 60fps.
That's insane to me. A generation ahead was technically possible at the time, but obviously not practical to produce at the time due to lack of insight and other things.

Countering myself, there's also cases like the PSP which had an OS but till blows my mind with the results considering its specs. 222MHZ and 32MB of RAM ?!? wow
Much like the PS1.
>>
>>108843195
It's just about fuck all, especially if you give your program exclusive use of its cores.
>>
>>108847460
It's more like millions, tens of millions absolute top. They're just a fancy warehouse at the end of the day. The contents are way more expensive.
>>
>>108847127
it runs on bare metal, only one process is allowed
>>
>>108847108
You missed the biggest factor: virtual-to-physical address translation. The performance overhead for that is around 30%.
>>
>>108843195
I run XP and 7 on bare meal for GPU access in their vlibrary of software as well as using optical drive DRM shit offline, thus facilitating the vast physical media library I picked up for peanuts as well as stuff like the sidewinder force feedback
>>
>>108843195
>calculate the performance losse
some shit just will not work in a VM
>>
>>108847332
>Countering myself, there's also cases like the PSP which had an OS but till blows my mind with the results considering its specs
psp is an asesome little piece of tech
>>
>>108843195
yes, os devs have
/thread
>>
>>108843195
the real answer is don't use a non-deterministic OS and this isn't a worry
>>
File: Spinrite_logo.jpg (8 KB, 316x137)
8 KB JPG
>>108843195
I believe SpinRite used to run on some mini OS before it became a standalone thing. It's been a while though, but you can probably find changelogs and test results of before and after. Afaik it's significanly faster.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.