how about this one:mudlord wrote:Okay, I'll be nice. For Mr Kitty's sake as well.
How other people should write their software
-
- Locksmith of Hyrule
- Posts: 3634
- Joined: Sun Aug 08, 2004 7:49 am
- Location: 255.255.255.255
- Contact:
<Nach> so why don't the two of you get your own room and leave us alone with this stupidity of yours?
NSRT here.
NSRT here.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Oooh! Breakfast!
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
Breakfast? That's unsustainable; try this instead: kitten huffing.
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
Yes. But someone had to preempt him for once.mudlord wrote:Doesn't grinvader eat kittens?Oooh! Breakfast!
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding
-
- Trooper
- Posts: 394
- Joined: Mon Feb 20, 2006 3:11 am
- Location: Space
-
- ZSNES Shake Shake Prinny
- Posts: 5632
- Joined: Wed Jul 28, 2004 4:15 pm
- Location: PAL50, dood !
Those ones looked diseased.Nach wrote:Yes. But someone had to preempt him for once.mudlord wrote:Doesn't grinvader eat kittens? :oOooh! Breakfast!
I don't fancy poisoned treats.
皆黙って俺について来い!!
Pantheon: Gideon Zhi | CaitSith2 | Nach | kode54
Code: Select all
<jmr> bsnes has the most accurate wiki page but it takes forever to load (or something)
byuu,
http://mudlord.blogspot.com/2008/08/spe ... arity.html
There's my abbreviated response. I could have expanded a lot more, but I chose not to.
But basically, it shows the gist of what I think about optimization, and what I think of bloat & the relevance of optimization on ultra modern hardware.
Feel free to make a article as a rebuttal. I don't really mind.
EDIT: Fixed spelling and stuffles in blog post.
http://mudlord.blogspot.com/2008/08/spe ... arity.html
There's my abbreviated response. I could have expanded a lot more, but I chose not to.
But basically, it shows the gist of what I think about optimization, and what I think of bloat & the relevance of optimization on ultra modern hardware.
Feel free to make a article as a rebuttal. I don't really mind.
EDIT: Fixed spelling and stuffles in blog post.
Last edited by mudlord on Tue Aug 05, 2008 9:56 am, edited 2 times in total.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
Nach and I had a small discussion regarding this.. it falls to a few things IMO.
When CS/programming is taught, the students are never taught to optimize. This is a huge failure since this problem becomes systemic and there are tons of programs produced that could be significantly faster than what was written for it. I could easily point to games being a culprit, but an even more pratical example is the freaking word processor. When you think about load times, you shouldn't be requires to beef up your computer massively just to get Word running better. It makes absolutely no sense to me. Something like Word should load up as fast as Notepad, but that simply is not the case. Maybe it seems that I'm asking for a lot, but considering that it shouldn't consume insane resources or insane CPU just to write up a document. Is that asking too much? I don't think so.
One other thing.. commenting code nowadays seems to be a lost art, since it's probably not used so people can be mystified at what to do before eventually overhauling the code again...
When CS/programming is taught, the students are never taught to optimize. This is a huge failure since this problem becomes systemic and there are tons of programs produced that could be significantly faster than what was written for it. I could easily point to games being a culprit, but an even more pratical example is the freaking word processor. When you think about load times, you shouldn't be requires to beef up your computer massively just to get Word running better. It makes absolutely no sense to me. Something like Word should load up as fast as Notepad, but that simply is not the case. Maybe it seems that I'm asking for a lot, but considering that it shouldn't consume insane resources or insane CPU just to write up a document. Is that asking too much? I don't think so.
One other thing.. commenting code nowadays seems to be a lost art, since it's probably not used so people can be mystified at what to do before eventually overhauling the code again...
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
I 100% agree. Way too much stuff these days is either bloated, unoptimized, or both. Like Word 2003. Its utterly insane, same with loads other apps I use daily, like Visual Studio 2008. We really don't need the bloat. I just wish the devs just wake up and do something about it.When CS/programming is taught, the students are never taught to optimize. This is a huge failure since this problem becomes systemic and there are tons of programs produced that could be significantly faster than what was written for it. I could easily point to games being a culprit, but an even more pratical example is the freaking word processor. When you think about load times, you shouldn't be requires to beef up your computer massively just to get Word running better. It makes absolutely no sense to me. Something like Word should load up as fast as Notepad, but that simply is not the case. Maybe it seems that I'm asking for a lot, but considering that it shouldn't consume insane resources or insane CPU just to write up a document. Is that asking too much? I don't think so.
Note: I am not saying BSNES is either those 3 things (bloated/unoptimized/or both).
It seems to me that optimization as a final stage will have a better end result faster than optimizing as you go due to code volatility. Maybe it doesn't matter so much with a word processor, but with an emulator, you're trying to duplicate something you're in a constant struggle to understand. If some optimizations have a chance of being scrapped along the way or are going to hinder the author's ability to troubleshoot newly discovered problems, then why bother?mudlord wrote:byuu,
http://mudlord.blogspot.com/2008/08/spe ... arity.html
There's my abbreviated response. I could have expanded a lot more, but I chose not to.
But basically, it shows the gist of what I think about optimization, and what I think of bloat & the relevance of optimization on ultra modern hardware.
Feel free to make a article as a rebuttal. I don't care.
At the same time, hacks of some parts (PPU) are practically necessary in order to even test games at full speed and improve other parts, or generate interest from people like DMV27 who otherwise may not have contributed fixes if the emulator provided no immediate prospects of enjoyment. There is clearly a mix of philosophies at work here, I have no idea why these types of threads persist. Microsoft's overly aggressive product intervals are bloat magnets. Office is as clear a case as you could want. But I don't consider that to be the reason that bsnes is slow. Sorry if you do.
And you'll find that nearly every time that happens, the original poster was suffering some major, irresolvable issue in their game. People suggest bsnes because it's easy. Got a problem? Bsnes probably doesn't have it. People know this by now, they don't have to go check equally uncertain alternatives every time someone moans that all their games are glitching out.AamirM wrote:If you do a simple google search, you'll find that nearly on every forum there will be someone who will sugggest bsnes to play games.
I still feel though optimizing while going along instead of it being at the final stage is okay though. Sure its a choice some people make, but whatever works for them.t seems to me that optimization as a final stage will have a better end result faster than optimizing as you go due to code volatility. Maybe it doesn't matter so much with a word processor, but with an emulator, you're trying to duplicate something you're in a constant struggle to understand. If some optimizations have a chance of being scrapped along the way or are going to hinder the author's ability to troubleshoot newly discovered problems, then why bother?
This one existed purely out of polarities between byuu and I. Honestly, sometimes I wish I wasn't here at this forum, because of all the fights and stuff. As honestly, I hate all the resentment and arguments, as it really gets to me. Sure people will just say "its just the internetz", but to some people, its more than that.I have no idea why these types of threads persist.
Looks good to me, thanks for writing it :)There's my abbreviated response. I could have expanded a lot more, but I chose not to.
All of the niceties (video filters, special chip support, etc) probably aren't helping the perception that it's not meant to compete / replace other emulators ... but I suppose if it increases the number of people testing games, that's probably a good thing.And you'll find that nearly every time that happens, the original poster was suffering some major, irresolvable issue in their game.
That's pretty much my entire point. Get it right first, optimize it later. It's just that "right" to me, for this specific program, means perfect, and that's not possible ;)It seems to me that optimization as a final stage will have a better end result faster than optimizing as you go due to code volatility.
Yes, precisely, a choice. I certainly don't mind if people optimize as they go along.I still feel though optimizing while going along instead of it being at the final stage is okay though. Sure its a choice some people make, but whatever works for them.
The sad part is that I don't really even think we disagree. Like politicians, we just have two ways of saying the same thing.This one existed purely out of polarities between byuu and I.
Yes, I certainly appreciate optimized code and think it has a lot of value. And in 99.9% of cases, I agree with your approach. I also agree that VS2k8 and Word are ungodly slow, and there's not much excuse for that. Especially considering those products cost money. I hate the fact that even the "runs on legacy hardware" major Linux distros consume all available RAM on my 512MB machines, unless I go with Xfce.
I even agree with you for writing general emulators, even accuracy-focused ones. But I want to do something different: a niche of a niche, I want the code to be self-documenting so that other emulators can implement my findings. And they do, see zones' additions to IRQ timing in SNES9x for but one example. Really, that's my #1 goal -- I'm not worried about speed because I'm not aiming for people to play it. It's just that I kind of need people to in order to find bugs and such.
It's a truly exceptional case to the rule is all. If you look at my other software, you'll find it may not be the fastest, but it's quite fast in general. xkas can assemble ~200kb of source in less than 1/10th of a second. Der Langrisser uses all kinds of tricks to increase speed (like a vblank polling routine that checks latch ranges to avoid an extra frame seek if we're already in vblank -- something I've never seen anyone else do), etc. Unlike many fan translations, there's no visible slowdown compared to the original.
But I don't even ask that anyone agrees with my approach here, just that they respect it, as it's what I want to do personally.
Not to add insult to injury, but in the interest of fairness -- you were the one who brought this up in the first place :/Honestly, sometimes I wish I wasn't here at this forum, because of all the fights and stuff.
I'm sure I've started others though.
I agree though that's it getting old. Let's both try to be nice, even if we disagree -- we can at least respect that the other can do whatever he wants with his project and should be able to do without criticism. And if one of us starts bickering here, we'll have FitzRoy delete all of said posts. Sound good? :)
No probs. Least I got my main point across in how I approach things.Looks good to me, thanks for writing it
Yes, and then that leads to all the bickering and stuff. Which isn't nice for both of us, considering we do get along. Its only when the contentious issues start that problems get abound.The sad part is that I don't really even think we disagree. Like politicians, we just have two ways of saying the same thing.
Exactly. If I was paying for a product, I would expect it to run well, and be optimized for such. And the software devs around that charge for bloated POS'es of software really don't deserve the money.Yes, I certainly appreciate optimized code and think it has a lot of value. And in 99.9% of cases, I agree with your approach. I also agree that VS2k8 and Word are ungodly slow, and there's not much excuse for that. Especially considering those products cost money. I hate the fact that even the "runs on legacy hardware" major Linux distros consume all available RAM on my 512MB machines, unless I go with Xfce.
As for the Linux comment I agree. Fluxbox for me works equally well to Xfce. I honestly don't care for looks in GUIs, just functionality. So I really don't see the point in Aero, Compiz Fusion and stuff....
Ah I see...so thats why theres not much commenting in the BSNES source...Still I think code commenting is nothing bad.But I want to do something different: a niche of a niche, I want the code to be self-documenting so that other emulators can implement my findings. And they do, see zones' additions to IRQ timing in SNES9x for but one example. Really, that's my #1 goal -- I'm not worried about speed because I'm not aiming for people to play it. It's just that I kind of need people to in order to find bugs and such.
Sound perfect to me.I agree though that's it getting old. Let's both try to be nice, even if we disagree -- we can at least respect that the other can do whatever he wants with his project and should be able to do without criticism. And if one of us starts bickering here, we'll have FitzRoy delete all of said posts. Sound good?
-
- Romhacking God
- Posts: 922
- Joined: Wed Jul 28, 2004 11:27 pm
- Contact:
I'm going to play devil's advocate here. You two love to throw around Word and Visual Studio as your examples of unoptimized, bloated programs. However, do you really know this to be true? With all the features in Visual Studio 2008 and Word, do you really think you could create something better? There's just no backing substance to your claims other than the programs are slow in loading. You have no idea why they are slow nor how they could be improved.
I'm not agreeing nor disagreeing with whether or not they are bloated. Just throwing out the fact that these claims seem frivolous to use as supporting evidence of your opinion of poor software design without backing.
P.S. Notepad is slow as hell to open and do anything with large files. That doesn't win any awards for speed in my book either.
I'm not agreeing nor disagreeing with whether or not they are bloated. Just throwing out the fact that these claims seem frivolous to use as supporting evidence of your opinion of poor software design without backing.
P.S. Notepad is slow as hell to open and do anything with large files. That doesn't win any awards for speed in my book either.
[url=http://transcorp.romhacking.net]TransCorp[/url] - Home of the Dual Orb 2, Cho Mahou Tairyku Wozz, and Emerald Dragon SFC/SNES translations.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
[url=http://www.romhacking.net]ROMhacking.net[/url] - The central hub of the ROM hacking community.
That same logic applies to Windows Vista too.I'm going to play devil's advocate here. You two love to throw around Word and Visual Studio as your examples of unoptimized, bloated programs. However, do you really know this to be true? With all the features in Visual Studio 2008 and Word, do you really think you could create something better? There's just no backing substance to your claims other than the programs are slow in loading. You have no idea why they are slow nor how they could be improved.
More often than not, there is criteria for bloated software. LikeHowever, do you really know this to be true?
* Large harddrive footprint
* Large RAM requirements
* Large CPU requirements
VS2008 takes up all 3, not to mention the MSDN Library, which adds another 2-3GB.
Yes its all subjective, but there are some common attributes of "bloated" software. And MS often calls thier extra bloated things added "features".
I see a point in Aero, which I think is very important - as the whole desktop environment is hardware accelerated by the video card and it's done really nice, you DON'T have any visual tearing when moving windows, or which is the most important, scrolling. Combining this with ClearType makes life for my eyes much easier (using TN panel) . Please show me other systems with such behaviour, so I can stop using Vista.As for the Linux comment I agree. Fluxbox for me works equally well to Xfce. I honestly don't care for looks in GUIs, just functionality. So I really don't see the point in Aero, Compiz Fusion and stuff....
Ah I see...so thats why theres not much commenting in the BSNES source...Still I think code commenting is nothing bad.
Code: Select all
/*****
* One PPU dot = 4 CPU clocks
*
* PPU dots 323 and 327 are 6 CPU clocks long.
* This does not apply to NTSC non-interlace scanline 240 on odd fields. This is
* because the PPU skips one dot to alter the color burst phase of the video signal.
*
* Dot 323 range = { 1292, 1294, 1296 }
* Dot 327 range = { 1310, 1312, 1314 }
*****/
//dram refresh occurs once every scanline
status.dram_refreshed = false;
if(cpu_version == 2) status.dram_refresh_position = 530 + 8 - dma_counter();
//hdma triggers once every visible scanline
status.line_rendered = false;
status.hdma_triggered = (status.vcounter <= (ppu.overscan() == false ? 224 : 239)) ? false : true;
//interlaced even fields have one extra scanline (263+262=525 NTSC, 313+312=625 PAL)
if(ppu.interlace() == true && ppu.field() == 0) status.field_lines++;
//H/DMA pending && DMA inactive?
//.. Run one full CPU cycle
//.. HDMA pending && HDMA enabled ? DMA sync + HDMA run
//.. DMA pending && DMA enabled ? DMA sync + DMA run
//.... HDMA during DMA && HDMA enabled ? DMA sync + HDMA run
//.. Run one bus CPU cycle
//.. CPU sync
/*****
* last_cycle()
*
* Used to test for NMI/IRQ, which can trigger on the edge of every opcode.
* Test one cycle early to simulate two-stage pipeline of x816 CPU.
*
* status.irq_delay is used to simulate hardware delay before interrupts can
* trigger during certain events (immediately after DMA, writes to $4200, etc)
*****/
//initial latch values for $213c/$213d
//[x]0035 : [y]0000 (53.0 -> 212) [lda $2137]
//[x]0038 : [y]0000 (56.5 -> 226) [nop : lda $2137]
add_clocks(186);
But take things like this for instance:
Code: Select all
//DMAEN
void sCPU::mmio_w420b(uint8 data) {
for(unsigned i = 0; i < 8; i++) {
channel[i].dma_enabled = data & (1 << i);
}
if(data) status.dma_pending = true;
}
One problem is that it's really difficult to explain a lot of the really complex stuff in comments.
For instance, take a look at the recent HDMA findings thread. It would suck to have a 10-paragraph explanation of how DMA sync works alongside ~6 lines of actual code. It would make editing the code hard when it's immersed in an ocean of comments :P
What I really need is to write up real external documentation, and reference that in the code.
"DMA sync code. See /doc/s-cpu/dma.pdf for basic outline."
It would also be nice if there were some sort of universal standard for a "collapsed by default" comment, so you just get a little "?" box or something to hit if you want to see the long dissertation comments.
-
- ZSNES Developer
- Posts: 6747
- Joined: Tue Dec 28, 2004 6:47 am
I didn't throw out VS, but I wonder how much stuff has to be loaded so it's happy.. not that it actually matters when time is spent compiling and debugging, that those minor things can be sped up and be helpful is always welcomed.Nightcrawler wrote:I'm going to play devil's advocate here. You two love to throw around Word and Visual Studio as your examples of unoptimized, bloated programs. However, do you really know this to be true? With all the features in Visual Studio 2008 and Word, do you really think you could create something better? There's just no backing substance to your claims other than the programs are slow in loading. You have no idea why they are slow nor how they could be improved.
I guess it depends more on the primary usage of the app. If you only use 10% of an app's features and that app consumes 1GB, you wonder if you spent that space wisely. If the app is like 2MB but its feature filled, noone tends to notice this extra stuff as bloat.I'm not agreeing nor disagreeing with whether or not they are bloated. Just throwing out the fact that these claims seem frivolous to use as supporting evidence of your opinion of poor software design without backing.
Oh, I'm very aware of that.. I'm only referring to a simple "open app" case than a "open huge file" case. It's woefully insufficient but then again, you shouldn't expect to use it for that purpose in the first place...P.S. Notepad is slow as hell to open and do anything with large files. That doesn't win any awards for speed in my book either.
Continuing [url=http://slickproductions.org/forum/index.php?board=13.0]FF4[/url] Research...
-
- ZSNES Developer
- Posts: 3904
- Joined: Tue Jul 27, 2004 10:54 pm
- Location: Solar powered park bench
- Contact:
If you want to determine if an app is bloated as defined above, it's easy to see by comparing to the competition. If the competition has a similar feature set but is a 10th the size, loads instantly, and works on slow CPUs, you have an indicator right there.
Most office applications today by the big companies ARE bloatware.
Most office applications today by the big companies ARE bloatware.
May 9 2007 - NSRT 3.4, now with lots of hashing and even more accurate information! Go download it.
_____________
Insane Coding
_____________
Insane Coding