560 karma · joined July 8, 2010
So, like:
var SomeFunc = RequireAuth(func(...) {
...
});
However, there's no language-level support, so you can't decorate methods as easily as you might in a language like Python.So, you can pretty easily leak memory without messing with unsafe things.
Maybe it's a matter of training, but
@_update_status_position(e, files)
looks much clearer to me than @_update_status_position e, filesAh, yeah, I was testing a much much smaller byte array with multiple split points. I'm not terribly surprised that in your case you've found the hand-coded byte version to be faster (though the difference is more than I would've guessed; care to post the code?) However, I'm still not sure it's merited in the standard library. Split() could pretty easily be further specialized to basically call your single byte implementation or equivalent at the cost of a handful of instructions per call. Alternately, if you know you're dealing with very large byte slices with only a few split points, it is only a couple lines of code to write a specialized version that is tuned for that. The same argument could be make for IndexByte, but I'd claim that IndexByte is a much more fundamental operation in which one more often has need for a hand-tuned assembly implementation. I wouldn't say the same for Split. There's a benefit to having fewer speed-specialized standard library calls, and I don't think splitting on a byte with performance as a primary concern happens often enough to merit another way to split on a byte in the standard library. But I'm certain that reasonable people who are smarter than me would disagree.
I think they made the right choice there; the Go team seems very good about optimizing only where it matters; there's lots of low hanging fruit, but the majority of it isn't very useful fruit.
That and similar type-specific handling could be built into the json package fairly easily, and would make those cases quite a bit faster. Then again, I bet the Go team would have a better and more general idea.
I do wish the Thrift support was as good as the protocol buffer support, though. :)
"You retain full ownership to your stuff. We don’t claim any ownership to any of it."
Or am I missing something?