Disappointment and time wasted

All off topic discussions go here. Everything from the funny thing your cat did to your favorite tv shows. Non-programming computer questions are ok too.
Post Reply
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Disappointment and time wasted

Post by VolTeK »

I had decided to stop pushing off a project i have been thinking of, and decided to get working on it. It was to redo the way my FAT driver handles, well, the FAT.

My current design is for size, and not speed. Searching a sector at a time, and each fat entry read, means a sector read.

So i wanted to cache the entire fat, and have the kernel handle senarios where the floppy disk is released, to then deallocate the last buffer containing fat data, and reupload another with new information from the new disk.

I had thought that keeping this information in memory would minimize the amount of reads from the disk it would take to load or write a file. I made a fairly stable version of what i wanted, and it did just that but...


it was nearly the exact same speed as the last driver. I was, and still am disappointed this barely had any effect. So i took my last one back, and decided to move on with what i had. For now what does it matter.


Have you ever spent days working on a small fix for your project and it turn out not doing what you had wanted, and in fact gave negative results?
User avatar
brain
Member
Member
Posts: 234
Joined: Thu Nov 05, 2009 5:04 pm
Location: UK
Contact:

Re: Disappointment and time wasted

Post by brain »

Yes. Many years ago before I knew the benefits of version control, I made a change such as this that broke my project (not osdev) and wasn't able to roll it back because the change took so long it was in all my backups. lesson learned from then on, all I could say was... OUCH!
Rudster816
Member
Member
Posts: 141
Joined: Thu Jun 17, 2010 2:36 am

Re: Disappointment and time wasted

Post by Rudster816 »

How are you benchmarking it? If you're trying to benchmark it in an emulator, that won't work at all because AFAIK, they don't emulate the speed of the HDD\FDD's. I think it would be damn near impossible to make a FAT caching scheme so slow that it performs the same as an uncached version. Floppies are just so slow nowadays its quite funny. I wouldn't be the least bit surprised if getting the sector(s) for the cluster from a cache was in the region of millions of times faster than just reading it from the floppy.
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Disappointment and time wasted

Post by bluemoon »

How many cache hits and misses in your benchmark?
For small file you only read the FAT once and I think the cache will never hit again.
However, for large file you will hit the cache again and improve performance.
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Disappointment and time wasted

Post by xenos »

Even if the work and effort you invested in changing your code did not give you the expected results, it was not a waste of time. You learned something and gathered more experience. I think this is one of the greatest benefits one can get from doing things such as osdev.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
Jezze
Member
Member
Posts: 395
Joined: Thu Jul 26, 2007 1:53 am
Libera.chat IRC: jfu
Contact:

Re: Disappointment and time wasted

Post by Jezze »

Do not underestimate the power of trial and error!

Yeah I've abandoned ideas quite a few times. I sometimes have a hard time to see what the actual result would look like so I start writing something and paint myself into the corner and then I'm like "Ah right... THAT was why this idea wouldn't work". As soon as come to this conclusion I think to myself, is there some other way around this? No. Ok revert. It has actually happened that I've repeated the same mistake twice because I forgot I've already tried it and it didn't work.
Fudge - Simplicity, clarity and speed.
http://github.com/Jezze/fudge/
User avatar
xenos
Member
Member
Posts: 1118
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: Disappointment and time wasted

Post by xenos »

Jezze wrote:"Ah right... THAT was why this idea wouldn't work"
I have one of those moments at least once per day :D
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Disappointment and time wasted

Post by VolTeK »

Rudster816 wrote:How are you benchmarking it? If you're trying to benchmark it in an emulator, that won't work at all because AFAIK, they don't emulate the speed of the HDD\FDD's. I think it would be damn near impossible to make a FAT caching scheme so slow that it performs the same as an uncached version. Floppies are just so slow nowadays its quite funny. I wouldn't be the least bit surprised if getting the sector(s) for the cluster from a cache was in the region of millions of times faster than just reading it from the floppy.
bluemoon wrote:How many cache hits and misses in your benchmark?
For small file you only read the FAT once and I think the cache will never hit again.
However, for large file you will hit the cache again and improve performance.
Now reading that, i haven't had any time to take it into consideration, i have saved both attempts in their own folders and from reading that.. i may just make a third one now ;) Thanks
User avatar
VolTeK
Member
Member
Posts: 815
Joined: Sat Nov 15, 2008 2:37 pm
Location: The Fire Nation

Re: Disappointment and time wasted

Post by VolTeK »

I did work on my file system driver

what i did wrong, was assume that if it ran any faster in virtual pc it would be better. I had crunched working on this into nights when i had time, i did not have time to put this on an actual floppy to test on a real machine. I have learned now that any virtual machine is bad to test for speed when it comes to topics such as disk drivers.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Disappointment and time wasted

Post by Chandra »

VolTeK wrote:Have you ever spent days working on a small fix for your project and it turn out not doing what you had wanted, and in fact gave negative results?
Several times, if you must know. But that is how it is supposed to be. You can't expect to get perfect results the very first time. As Jezze said, the only way to progress is the route of 'Trial and Error'.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
invalid
Member
Member
Posts: 60
Joined: Thu Feb 23, 2012 8:39 am

Re: Disappointment and time wasted

Post by invalid »

VolTeK wrote:any virtual machine is bad to test for speed when it comes to topics such as disk drivers.
After all, it's just virtual hardware. My floppy driver failed to read anything on real hardware when tested for the first time - and yes, it was due to various delays which are not emulated by VM.
rdos
Member
Member
Posts: 3276
Joined: Wed Oct 01, 2008 1:55 pm

Re: Disappointment and time wasted

Post by rdos »

It was many years ago that I optimized my FS driver. I even run benchmarks with Windows in order to test it. It turned out that the most important optimization was to keep files mapped in memory. That was many times more important than optimizing the FS driver. OTOH, it depends on what type of benchmark is run.

About learning to backup (and eventually using version control), I learned this early on with my OS project. I also had a few failures that I couldn't locate, and needed to restart from a known-good point. I never had any fatal errors that forced me to start from the begining though, but I came close a few times. I've had a few of those recently as well (one was with the SMP implementation).
linguofreak
Member
Member
Posts: 510
Joined: Wed Mar 09, 2011 3:55 am

Re: Disappointment and time wasted

Post by linguofreak »

VolTeK wrote:what i did wrong, was assume that if it ran any faster in virtual pc it would be better. I had crunched working on this into nights when i had time, i did not have time to put this on an actual floppy to test on a real machine. I have learned now that any virtual machine is bad to test for speed when it comes to topics such as disk drivers.
Indeed. Keep in mind that on a VM, the host OS is likely to already have disk caching going.
Post Reply