Domain: dotnetperls.com
Stories and comments across the archive that link to dotnetperls.com.
Comments · 28
-
Re:Android
the unsafe delegates
As I understand correctly, C# delegates are only signature-safe. So the delegates are "safe" as Pythons functions if they follow the method signature. But from a strongly typed language I expect "safe" to mean "type-safe" not "signature-safe". So for example you have the following code:
// C# delegate void Fire(double, double); ...
public Fire fire;
// Java
interface MissleLauncher { void fire(double, double); }
interface FireIgnator { void fire(double, double); } ...
public FireIgnator ignator;In C# code, fire can mean different things in different contexts. You can assign fire everything, it just have to meet the method signature. But for ignator you can assign only a FireIgnator.
Not sure what's clumsy about it
It's just so many { and } in C# (4 levels of braces):
namespace foo {
class Foo {
public int Xx {
get { }
set { }
}
}
}
Other language have solved that problem in a more elegant way, for example Groovy:
class Foo {
def xxx // automatic setter and getter
def getXxx() { } // override the getter
void setXxx(def foo) { } // override the setter
} ...
Foo foo = new Foo()
foo.xxx = "new value"
println foo.xxxThat there are other issues with C# that I dislike. For example:
- the IXxxx for interfaces. I mean really, what is the point? You shouldn't care less if it's an interface or not, since it's OOP, which means that you should not known which specific implementation you are programming to.
- the 100s (exaggerated a little) of keywords, also see Ten C# Keywords That You Shouldn’t Be Using
- the distinction between class/struct. Optimization should happen without that the programmer should care about. The VM should be intelligent enough to notice when a class it's just value holding record and optimize it. Also see C# Optimization Secrets
Unless you know more about the C# language than I do, it is typically best to avoid structs entirely. If you use structs, you must be careful to not pass the struct as a parameter to methods often, or performance will degrade to worse than using a class type. The reason for this is that structs are copied in their entirety on each function call or return value.
- namespaces, #region, ref, out, arrays/jagged arrays (why two incompatible array types?)
-
Re:Memory footprint should be first priority
Firefox is slower than chrome, but generally uses less memory. There were a couple versions of FF that had a memory leak problm if I recall.
See http://www.dotnetperls.com/chrome-memory too -
Re:But the memory leaks still aren't fixed.
There are tons of more extensive tests than simply leaving the browser running all day, and Firefox uses the least memory in nearly all of them. Perhaps Firefox leaks on your computer, but not on mine and nearly all other users. If its trivial to trigger the memory leak you're seeing, then it should be trivial to make your own test that we can run that demonstrates this memory leak we don't seem to be able to see.
-
Re:Mozilla is selling out
Reading this story in Chrome. Chrome is so much better. Google developers must know how to use malloc and free.
Reading this article in Firefox, it doesn't look like Chrome is conservative at all with how much memory it takes.
-
Re:How about fixing memory leaks first?
actually, they do, Chrome is the browser using the most memory of them all. It doesnt mean it has leaks. Just uses more memory. Mostly due to heavily sandboxing and per process model.
http://www.dotnetperls.com/chrome-memory (yes, its a bit over a year old, but still) -
Re:Feature Bloat
That memory leak was fixed a long time ago. And by that I mean since at least Firefox 3.5. I realize that trolls seem to think otherwise, but as of Firefox 3.5 it was beating the crap out of chrome and most of the other browsers in terms of memory allocation. Chrome and Firefox 3.5 Memory Usage As far as the rendering engine goes, it's stable, they're working on it and it's getting better but they have to worry a lot more than the Google folks do about pissing off a large user base by making substantial changes to the rendering engine every release. And yes, that makes a difference. I like that Firefox doesn't typically break my web experience when I update.
-
Re:Performance Much Better
Firefox tends to top out at about 250mb of RAM typically, lately it's gone above that, but if you leave it sit for a few days or keep it open constantly it tends not to go much above that. There was a comparison a while back between the major browsers and Firefox beat the crap out of the other ones. Unfortunately, that was a while back and so it's not particularly informative anymore, but that was relatively recently, think 3.x series.
Most of the time when people claim that Firefox is leaking memory it's not the browser it's one of their addons or their doing something really strange. I'm sure there are cases where individuals do wind up with it eating up a lot of memory, but it's something they're generally aware of. That's one of the things they're keeping an eye on with those studies.
Chrome and Firefox 3.5 Memory Usage I think this is the comparison I saw, the situation is likely to have changed since then.
-
Re:FF == the next Netscape?
Certainly every browser has memory leaks, and browser releases fix memory leaks all the time. The question is -- do the memory leaks leak enough memory to cause problems? In Firefox's case, the answer seems to be "no", because Firefox uses less memory than other browsers when performing common tasks. If you think you have found a bad memory leak in Firefox, you're welcome to write up a benchmark that will demonstrate Firefox using more memory than other browsers.
-
Re:FF4 vs. Chrome?
As far as I know Chrome does not encrypt the bookmarks at all. It's also only the bookmarks afaik that are saved
As for the memory, several tests have been made with what seemed to be accurate measurements, although it's not been made vs FF4 I expect results to be similar at least. Eg http://dotnetperls.com/chrome-memory
-
Re:FF4 has some pretty serious memory leaks still,
As I've said, I've tried this. Firefox's memory use tops 200 MB after two weeks. Other browsers go over 200 MB in a few days. I'm not attacking you, just stating for the record that I cannot see a problem. Perhaps on your computer that problem exists. Do not assume that every other Firefox user in the world sees the same problem. I do not. If you don't believe me, look at any number of memory tests that show Firefox using less memory than other browsers: 1 2 3 4, and many more!
-
Re:Too little, too late...
-
Re:Too little, too late...
-
Re:Chrome, you're losing me!
From http://dotnetperls.com/chrome-memory:
Google Chrome posted the highest maximum memory usage when all chrome.exe processes were summed, reaching 1.18 gigabytes, while Firefox posted the lowest maximum memory levels of 327.65 megabytes. This means Firefox used 73% less memory during peak periods.
Their methodology is flawed. The operating system will share identical unmodified memory pages between processes once in memory. So if they simply summed @ the total memory usage for each process, they could be counting the same piece of memory multiple times.
In Firefox, the single-process model makes it easy to measure the memory use of the process, but brings with it all it's flaws, (much easier to take out the whole session with a bad plugin)
Measuring memory usage of a multi-process application requires figuring out many pages are uniquely mapped amongst all processes, then summing that figure
-
Re:Chrome, you're losing me!
I started using Chrome because it was an improvement over the other browsers. It was faster, it used less memory...
Faster perhaps, but less memory? Many tests show it uses more memory than other browsers.
http://lifehacker.com/5457242/browser-speed-tests-firefox-36-chrome-4-opera-105-and-extensions http://dotnetperls.com/chrome-memory
http://www.whoisandrewwee.com/browsers/verdict-on-google-chrome-memory-hog/ -
Re:Lone Wolf
It's true that Firefox has typically been playing catch up throughout its lifespan. However, in the last 18 months, it has been seriously lagging behind other browsers (IE aside). Process separation, general speed, stability, memory fragmentation, etc.
This meme about Firefox memory fragmentation just won't die! Firefox 3.0.x you could still claim that Firefox was sucking down more and more memory as pages got visited. With 3.5.x, you can kiss that problem pretty much goodbye - Firefox returns more memory back to the system than any competing browser.
And Firefox isn't the largest memory consumer here either - that prize probably goes to Chrome, simply because one-tab-per-process is inevitably a heavier memory requirement.
Firefox stability is still a minor issue. However, it's stable enough that I get about 1 crash every three days, which is well within my tolerance level (14 extensions, 11 plugins). Tools like abrt provide a decent mechanism for informing the necessary bug trackers.
Speed-wise, Firefox devs know they are in a race with Chrome. 3.6.x looks like it will be faster than 3.5.x by a fair margin. Project Electrolysis stands to improve matters further. I'm all for competition - keeps everyone working on the issue.
Give me a plugin sandbox so that Flash trapping doesn't take out the page and I'll be content.
Cheers,
Toby Haynes -
Re:Memeory Leaks
Firefox at this point is really quite reasonable with its memory use - I can't get my head around the continual complaints. The only area where it's appreciably worse performing than Chrome is in UI responsiveness and this has significantly improved in 3.5. It also has far faster back/forward navigation through the cache and (although I don't have figures for this) it feels faster at displaying pages without extremely heavy javascript. There's also less flicker - most pages load in one paint rather than loading in sections. Besides that, web browsers have a lot of useful RAM caching they can do (your history, uncompressed images etc) - it hardly makes sense to keep browser usage below 174MB when even netbooks come with 1-2GB and that RAM can be used effectively to speed up the browser. Frankly, if you're too stingy to splash out on a stick of RAM use xterm with lynx or another browser from the era when that amount of RAM was normal.
-
Re:Comments about bloat
Want me to show you output from top? Also, to be able to run multiple programs at once - as most geeks expect to do - I expect my browser to be well under 1GB. In fact, since all it's doing is rendering web pages, it should be well under 100MB.
Well, you're better off with firefox than other modern browsers in that case.
-
Re:Original Firefox goals forgotten...
Thanks non-AC.
And of course, if you get right down to it...
http://dotnetperls.com/chrome-memoryNow of course, Firefox has a process-per-tab build too, I just hope it never becomes default. (although forcing plugins into a separate process might be nice, esp since I whitelist Flash anyway)
In terms of rendering speed, Firefox tends to be slightly ahead on rendering, and TM/SFX/V8 are basically all tied up way beyond IE8's JScript. TM does have a couple of issues. I'd say the work on implementing merge traces should help the most w/ things like jsMSX, and expanding the size of strings with its problems in string tests.
TM, last I checked, still has more efficient arrays than V8. -
Re:We use Opera on a daily basis
I don't think that Opera does use less memory than Firefox. Perhaps if you're going really nuts with the extensions Firefox will use more, but all the figures I've seen indicate that the current browser has a really low footprint.
http://dotnetperls.com/browser-memory -
Re:Humiliated By Google's Chrome
Arg. Slashdot didn't parse my link. Here's the test I meant to refer to.
-
Re:Using Chrome now, but....
You might wanna recheck your preconceptions - a lot has changed in the past few releases for Firefox: http://dotnetperls.com/chrome-memory
That benchmark is worthless. Especially for Chrome. Quote: "When a process with the same name such as 'chrome.exe' is encountered more than once, its total size is accumulated, yielding a total of all the 'chrome.exe' figures together." Apparently the author has never heard of shared memory! See Google Chrome Memory Usage - Good and Bad on the Chromium blog for some discussion on this.
The other browsers might not be using multiple processes, but the same flaws apply to a lesser degree. Every library they load will count against them, even if another app is using the library and so it would be in memory anyway. The only reliable way to tell how much memory a process is really using is to check memory usage, use program, check memory usage, kill program, check memory usage. If the first and third figures are equal, then you can get a correct figure by subtracting the second figure from their common value. (If they aren't equal, either the app hasn't actually exited fully, or some other program has eaten up more memory in the meantime and the results are no good.)
Granted, I doubt Firefox is such a comparative memory hog as people paint it to be, but the benchmark proves nothing either way.
-
Re:Using Chrome now, but....
You might wanna recheck your preconceptions - a lot has changed in the past few releases for Firefox: http://dotnetperls.com/chrome-memory
It's too bad a lot of people still think Firefox is such a memory hog when really they've refined it to be one of the most quick and efficient browsers available.
That said, your mileage may vary depending on the add-ons you choose, but as long as you don't go overboard there's no reason your memory usage should be significantly different than those in the benchmark.
I have the latest versions of Firefox and Chrome and my switchover was not all that long ago (a month, maybe two). I tend to use both browsers in the same way, about 6-10 tabs open at the same time, with all of them getting some use, and many of them being used at almost the same time.
After having stared at the task manager and seen FFX taking up over 400MB of RAM while I see Chrome using 150-170 to do the same things, I can pretty much tell you that there's no preconceptions involved, only data. I am not incredibly enthusiastic about the alternatives, but the facts are staring me in the face.
Perhaps my mileage varies. I am a very heavy browser user and I freely admit to being the guy who has all those tabs open. I'm not really complaining about FFX taking up a lot of memory, I'm more concerned that it takes up more to do the same things that other browsers seem to do for less.
-
Re:As usual with new Firefox releases...
Firefox really needs a multiprocess architecture.
think again. bad idea if you want to conserve memory
... http://dotnetperls.com/chrome-memory -
Re:As usual with new Firefox releases...
perhaps you missed this post from last week
... http://tech.slashdot.org/story/09/06/20/1951212/Memory-Usage-of-Chrome-Firefox-35-et-al
referring to this article http://dotnetperls.com/chrome-memory -
Re:As usual with new Firefox releases...
according to this test is seems quite alright...
-
Re:I need stability
These days, I can't go a day without wanting to toss firefox out the window with it's "fat guy at the buffet" attitude towards my system resources.
Huh, I'm having far less problems with Firefox 3.0's new memory manager.
-
Re:Firefox is a pig
I guess you missed the memo? If that article's to be believed, Firefox 3's memory usage is around 50% - 75% of Opera 9.5's. Or am I misreading the graphs?
-
Re:Extensions are bad?
Except that Opera provides all of these things without the bloat.
And yet, Firefox 3 uses less memory than all the other browsers, including Opera. You were saying?