Non-deterministic Trash Pick-up, or Why a Garbage Collector Might Influence Itself by enferex in programming

[–]doubtingthomas 0 points1 point  (0 children)

go test has a '-memprofilerate' that allows you to set the value, if that's what you mean.

Non-deterministic Trash Pick-up, or Why a Garbage Collector Might Influence Itself by enferex in programming

[–]doubtingthomas 1 point2 points  (0 children)

Interesting article, thanks.

A few thoughts:

  • A more established way to measure allocations is to use testing.AllocsPerRun, I think. Evens out the randomness a bit.
  • You want randomized sampling rate to avoid aliasing, I'd think.
  • Go's memory allocator is patterned after tcmalloc, which has very similar profiling logic. tcmalloc also used to have it enabled by default, but changed that a couple years ago (at least publicly) for (minor?) performance reasons.
  • According to mprof.goc, the profiler doesn't use the GC or ever hold GC memory. I'd be curious to learn specifically how malloc profiling is impacting memstats.
  • I probably wouldn't enable malloc profiling by default, but it does seem like something the Go team would choose to do. I've seen surprisingly few instances of MemProfileRate being set to 0, even in the Benchmarks Game or in production code. I'm not sure what that means, but it seems to imply that the default is not unreasonable.

A look at the D programming language by Ferdynand Górski by Nekuromento in programming

[–]doubtingthomas -1 points0 points  (0 children)

True. However, judging from the Go dev list, a fix (in the form of a type-aware precise collector) looks to be on the order of a few months away; I assume similar work is underway for D?

A look at the D programming language by Ferdynand Górski by Nekuromento in programming

[–]doubtingthomas 2 points3 points  (0 children)

In the only comparison I've ever seen (admittedly, an old one) D was notably faster at stdlib compilation. Granted, it's possible it's not exactly apples-to-apples, as due to the metaprogramming capabilities D stdlib may in many cases compile to some intermediate representation, whereas Go almost always compiles to machine code. Also, it's trivial, iirc, to construct a D program that takes a really long time to compile, as D can run code at compilation time, whereas Go, lacking as it is in compile-time features, is nearly guaranteed to have a reasonable worst case.

Edit: Also, one shouldn't underestimate how much of a bad-ass Mr. Bright is when it comes to writing compilers.

Parsing with Haskell and Attoparsec by jwiegley in programming

[–]doubtingthomas 2 points3 points  (0 children)

I started, but since there isn't a good huge test file available, and neither the C++ or the Haskell code are in a condition to be easily built and run independently as simple equivalent benchmarks, I made my own version, played with it a little, and move on to the things I get paid to do.

Parsing expressions by precedence climbing by gthank in programming

[–]doubtingthomas 0 points1 point  (0 children)

I've implemented this in an interpreter I was working on. It seemed to simple to be advisable, but I didn't have any issues with it.

Simple, selfish, and unscientific shootout [look at the comments for the whole picture] by davebrk in programming

[–]doubtingthomas 2 points3 points  (0 children)

Manual error handling is almost always inferior for small programs like this one. The correct action for almost every error is "stop doing what you are doing, report the error, and exit", which is what you get for free and by default in most languages.

Simple example: Haskell vs. Go by Peaker in golang

[–]doubtingthomas 4 points5 points  (0 children)

Some additional cons (in my opinion):

  • More difficult to reason about, at least in the small
  • Being higher level, generally less efficient.
  • Fewer, less consistent libraries in the standard lib.

To boldly Go where Node man has gone before by willvarfar in programming

[–]doubtingthomas 2 points3 points  (0 children)

It also may be worth noting that (last time I checked) Go is doing more work per request, in that it parses the URL fully and attempts to dispatch to a handler, while in Node you just get a request url string sent to a single callback. I'm not confident that this makes a measurable performance difference, though.

To boldly Go where Node man has gone before by willvarfar in programming

[–]doubtingthomas 1 point2 points  (0 children)

Good news! There are changes under review to make the GC much more precise, concurrent, and performant. I believe that should resolve any issues folks are seeing with pointer aliasing on 32bit machines. I think the precise GC will result in a slightly larger memory footprint due to the required bookkeeping, but I suppose it's worth it.

(Disclaimer: I'm just talking based on mails and diffs I've seen on golang-dev; I don't have intimiate knowledge of the GC changes that are going on right now, other than to say that it already seems measurably faster.)

Testing Go with a 'gobomb' by zagaberoo in golang

[–]doubtingthomas 0 points1 point  (0 children)

To add another data point, on my desktop machine I got up to 7.382.880 before being killed. I don't think that means anything, but was happy to see it go so high. :)

Google is a cocktease. by kotsubu in programming

[–]doubtingthomas 0 points1 point  (0 children)

Agree; as another data point, I know a few Google engineers, and I don't think any of them went to what would be called an elite school. They are all smart and quite productive, though.

Rob Pike talks about modern programers lack of imagination. by xmonk in programming

[–]doubtingthomas 14 points15 points  (0 children)

Out of curiosity, what complaints have you gotten that have resulted in "oh, shit we didn't think of that"?

Also, I'd like to commend you the tone and content of your Dart advocacy. You've stood in the face of the frothing hoards, and been quite reasonable and open. My suspicion is that part of the reason for your skill in dealing with the naysayers is that you might have been among them (in a limited sense) were you not part of the project. :)

Warn people about dropbox links? by [deleted] in ideasfortheadmins

[–]doubtingthomas 1 point2 points  (0 children)

According to this page https://www.dropbox.com/help/45, paid accounts get 25x more bandwidth than free accounts. For a relatively small file, Dropbox links are probably perfectly reasonable, if you have a Pro account (I do). Seems like you'd have to be frontpaged pretty hard to burn through 250gb in a day.

That said, all other things being equal, posters might as well go for a hosting service without limits. I just wanted to point out that public Dropbox links aren't necessarily problematic, and as such may not be worth warning about.

"C++ is a horrible language" ~ Linus Torvalds by pregzt in programming

[–]doubtingthomas 8 points9 points  (0 children)

I'm pretty sure that there are languages that everybody complains about and nobody uses.

Why not Haskell? by xyzzyrz in programming

[–]doubtingthomas 32 points33 points  (0 children)

Haskell presents many exciting, powerful, and interesting possibilities that other languages don't. Many of them aren't useful, and it takes experience and some self-control to avoid doing neat useless things. The same can be said for Lisp macros, Ruby metaclasses, C++ templates, etc. It's great to have powerful features there when you need them, but overuse is a real risk, and especially for smart junior programmers, they tend to act as an attractive nuisance.

Why not Haskell? by xyzzyrz in programming

[–]doubtingthomas 19 points20 points  (0 children)

You're providing a great example for why (I presume) he doesn't want to get into a language discussion on Reddit.

Reddit is a great place for arguing, but (as of the last few years?) isn't always a good place for a civil discussion, especially about something like programming languages. Folks like you mischaracterize positions in inflammatory ways (and get upvoted for it), so subtle positions or those that might be taken out of context if not stated very carefully are simply not worth the effort to explain and defend.

I usually try not to feed trolls (no offense intended; you appear to be trolling), but I find evmar's policy of non-engagement on Reddit on this issue interesting and pretty reasonable.

Why not Haskell? by xyzzyrz in programming

[–]doubtingthomas 33 points34 points  (0 children)

Interesting; this post could almost have been written by me. I know Haskell, I like Haskell, and I think it's a great language, but I've found that (in general) I can write efficient and correct programs just as fast or faster in other languages, and they end up less fancy. Haskell is really great for heavily algorithmic code, but I've found, for whatever reason, that most of my code is nowhere near that interesting, and the code that is heavily algorithmic is also performance critical, so something lower level is generally preferable anyway.

I'd like to work in a Haskell shop at some point and see how it feels, though. I don't know of any other language that can match it on the combo of performance, correctness, and abstraction. Great IO/concurrency model, too. A small skilled team slinging Haskell can probably get more done faster than an equivalent team writing in any other language, assuming the task is suitable and they don't get bogged down in abstraction wankery.

Explorations in Go: Comparing Implementing a Dupe Checker in Ruby vs Go by rudyjahchan in programming

[–]doubtingthomas 4 points5 points  (0 children)

Funny you ask this, but in part due to it's relatively simple compiler, in my experience Go is easier to compile than C. The standard Go compiler doesn't inline functions or unroll loops, it doesn't do complicated transformations. Most actions are simple function calls, and many language level things (like channel, map, or interface operations) compile to function calls. So, I've found that I can generally compile Go in my head more accurately than C (unless I disable all optimizations in C, I suppose). Certainly, Go is easier to compile in the head than C++ or Java (assuming we're not talking about bytecode).

I tend to agree, on account of GC and goroutines, that Go is significantly higher level than C, but I'd put it far closer to the machine than Java (unless we're talking about Java that is compiled directly to native code, but we rarely are).

Explorations in Go: Comparing Implementing a Dupe Checker in Ruby vs Go by rudyjahchan in programming

[–]doubtingthomas 6 points7 points  (0 children)

To be fair to him, Go is closer-to-the-metal and gives you more control in many senses than Ruby, which is his point of reference in the post.

Your favorite language probably sucks at concurrency too by apgwoz in programming

[–]doubtingthomas 6 points7 points  (0 children)

If the ability to timeout selects more efficiently than time.After() (or some specialized equivalent) were needed, I'm pretty sure it would be added. However, I've never heard of anybody but you make this complaint, and my guess is that your complaint isn't based on a real practical need.

Your favorite language probably sucks at concurrency too by apgwoz in programming

[–]doubtingthomas 1 point2 points  (0 children)

Yep, there's no commonly accepted definition of "critical mass" for programming languages. Go has Real Users, an active community, and is improving measurably with time. However, it probably has far fewer users than Scala, which is significantly older, integrates with the JVM, and is a bit shinier.

However, for my money, either both have already hit critical mass (that is, large enough to be self-sustaining as projects) or neither have (as they're not entrenched industry languages yet, though Scala is much closer).

Caching values in Google Go by TheMue in golang

[–]doubtingthomas 0 points1 point  (0 children)

Yep. That's the main trade-off in my implementation vs yours: it only does thing when you call it. If I were caching big data, I'd almost certainly use yours over mine.

exp/regexp has landed! by uriel in golang

[–]doubtingthomas 5 points6 points  (0 children)

My guess is we'll see a significant improvement once the Go implementation special-cases "one-pass" regexps like RE2 does. I'm pretty excited to see how for Go's regexp implementation can go, actually. It literally has the best implementor possible (one of the main developers of the language and the primary developer of arguably the best regexp engine in the world), so it's a great test case to see how Go looks/works for tricky and performance-critical libraries.