OSDev.org

The Place to Start for Operating System Developers
It is currently Tue Sep 27, 2022 3:05 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 3819 posts ]  Go to page Previous  1 ... 251, 252, 253, 254, 255
Author Message
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Thu Sep 22, 2022 6:47 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 985
devc1 wrote:
But whatever I had never tried to understand what is this hashmap. I just create linked lists

This proves my point. You are looking for performance at the micro level, which is the last place performance should be found at. You should first think about basic algorithms. A hashmap will be a linked list in lookup intensive operations always. Now is a hashmap always faster? No. It's about using the simplest thing that will give you the best performance.
devc1 wrote:
but I would want to optimize the Schedule(), malloc() and free()

In those cases, don't optimized code, optimize the algorithm and then the code.
vvaltchev wrote:
Then, people start to do benchmarks and look for "low-hanging fruits" to optimize. That's way too late.

Yeah, that's a big problem these days.

My personal philosophy about performance is that instead of "premature optimization is the root of all evil", premature micro-optimization is the root of a lot of evil.
devc1 wrote:
I don't (...) know why Windows, languages such as python, and companies are making all these huge and vast performance losses.

Python is actually pretty fast and more than acceptable for some (e.g., I/O bound) applications. I do agree that Python is overused, however.
devc1 wrote:
You have a (...) multi-core 4000000000 GHz CPU powered with the latest SIMD technologies and you still can't make fast applications.

You need to know that CPU performance isn't nearly as significant in many applications these days as it was before. Most tasks (such as a web server, a web browser, and other things) are actually I/O bound, meaning that the CPU spends most of its time idle and most time is spent waiting around for memory or the disk, which is significantly slower than CPU. Judicious use of disk and memory is key to fast applications these days. Of course some application's performance is bound by the graphics card (3D rendering, video editors, video games) and others are still CPU-bound (primarily software compilation and scientific number crunching, but even the latter is being moved to GPUs. Look up GPGPU). But most of the time, the disk and memory is the bottleneck.

For info on judicious use of memory, look at this research paper:

https://people.freebsd.org/~lstewart/articles/cpumemory.pdf

P.S. Mods, could you please split off this discussion?

_________________
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sat Sep 24, 2022 9:00 am 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 170
Quote:
optimize the algorithm and then the code.

That's what linked lists with the "bsf" (Bit Scan Forward) instruction do. Instead of looping on items, a simple 64 bit bitmap and the bsf instruction will simply sort a present entry. Such as pages, heaps...
Quote:
In those cases, don't optimized code, optimize the algorithm and then the code.

You're absolutely right.
Quote:
For info on judicious use of memory, look at this research paper

I already discovered it my self, I maximally try to minimize memory accesses in registers, using these methods my Scheduler was able to record a 5us per task switch on a pretty old laptop.

Devc1,


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sat Sep 24, 2022 12:59 pm 
Offline
Member
Member
User avatar

Joined: Fri Jun 11, 2021 6:02 am
Posts: 79
Location: Belgium
devc1 wrote:
I already discovered it my self, I maximally try to minimize memory accesses in registers, using these methods my Scheduler was able to record a 5us per task switch on a pretty old laptop.


That is not very fast at all. My barely optimized scheduler, in a microbenchmark, achieves 6µs in QEMU, 3µs on a laptop from 2013 and 7µs from 2012.

This post from 2006 measured context-switch times of an old Linux kernel on various CPUs. The fastest among them has a switch time of 0.89µs

This paper shows that the original L4 kernel achieved a 0.75µs context-switch time in 1997. Modern kernels apparently reduce this to 0.09µs on 32-bit x86.

_________________
My OS is Norost B (website, Github, sourcehut)


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sun Sep 25, 2022 6:58 am 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 170
Even if it's a preemptive multiple-priority based scheduler ?
the laptop I am testing it on is from 2008 : ))

But you're right, my new 64-bit scheduler is just garbage. Because my algorithm seems not right, I'll learn more on these priority based scheduling algorithms.


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sun Sep 25, 2022 10:25 am 
Offline
Member
Member

Joined: Fri May 11, 2018 6:51 am
Posts: 266
Guys, it looks to me you're mixing up the time consumed by the scheduler to make a decision with the context-switch time. Those things are very different: the context-switch time is the time it requires to switch to the next task (save and store all the registers, page directory etc.), assuming that we already know exactly which one the next task will be. The time consumed by the scheduler to make the decision about which will be the next is a completely different thing.

_________________
Tilck, a Tiny Linux-Compatible Kernel: https://github.com/vvaltchev/tilck


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sun Sep 25, 2022 11:00 am 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4421
Location: Chichester, UK
What’s this discussion got to do with what anyone’s OS looks like?


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sun Sep 25, 2022 1:07 pm 
Offline
Member
Member

Joined: Fri May 11, 2018 6:51 am
Posts: 266
iansjack wrote:
What’s this discussion got to do with what anyone’s OS looks like?
Nothing at all. Actually, we even asked if a moderator could move the discussion to a dedicated topic as it was good per se. I know we shouldn't continue it here but you know... one comment leads to another and so on.

_________________
Tilck, a Tiny Linux-Compatible Kernel: https://github.com/vvaltchev/tilck


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Sun Sep 25, 2022 4:34 pm 
Offline
Member
Member

Joined: Fri Feb 11, 2022 4:55 am
Posts: 170
Paused all my kernel development to Fight with 2D Algebra : )

- bezier curve connected with 4 points (in red), the gaps will be filled with LineTo() function.
- Rasterized shape (in blue)

Seems like next technology isn't it ? :)
An innovation in the design of OSes haha,

Image


Top
 Profile  
 
 Post subject: Re: What does your OS look like? (Screen Shots..)
PostPosted: Mon Sep 26, 2022 10:41 am 
Offline
Member
Member

Joined: Sat Nov 21, 2009 5:11 pm
Posts: 791
Symbolic debugging, and playing with 3D on an Intel 82845G GPU for which I can't find the manual. Fun fact, commands with errors cause the GPU to freeze and I haven't found a way to clear the error without resetting.


Attachments:
gos2609.jpg
gos2609.jpg [ 117.72 KiB | Viewed 49 times ]
WIN_20220926_17_55_18_Pro.jpg
WIN_20220926_17_55_18_Pro.jpg [ 57.47 KiB | Viewed 49 times ]
Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3819 posts ]  Go to page Previous  1 ... 251, 252, 253, 254, 255

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot], PetalBot [Bot] and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group