Hacker News new | past | comments | ask | show | jobs | submit login
Netflix's async sendfile now in FreeBSD-current (freebsd.org)
179 points by drewg123 on Jan 9, 2016 | hide | past | web | favorite | 28 comments

Slides from a presentation about async sendfile can be found at: http://www.slideshare.net/facepalmtarbz2/new-sendfile-in-eng...

Slide 27/36, aka. slide 18/23, shows a type of graph which I have also seen in the Google Chrome Dev Tools as well as a couple of other places. Someone told me once the name of that kind graph but I've forgotten what it was. I've never learned how to read that kind of graph. So, if someone would be so kind, please tell me what it's called and how to read it.

It's a flame graph or flame chart. I found this video explaining how to use them: https://www.youtube.com/watch?v=g0g4ML4nhPg

I think the basic idea is: say you have some code like this.

function a() { // 6 ms b(); // 3 ms c(); // 3 ms } Then you might have a flame chart that looks like this:



Essentially you're decomposing the time we spend in a() into its constituent pieces b() and c().

essentially, yes, but:

flame graphs: x-axis is sample population (or event time), alphabetical sort on function names to maximize merging

flame charts: x-axis is the passage of time

Great resource! Thank you.

Thanks :)

They call it a flame graph and what you are seeing are call stacks. X axis is time, Y axis is call stack depth.

The very bottom layer is the function you are analyzing, ever layer above is a function called by the one directly below it.

> X axis is time

That's not correct from what I'm reading.

If you are sampling the stack at equidistant points in time (or, sampling theorem and all, fast enough) and then determine the width on the basis of "seen in fraction of samples", that's pretty close to time. (timespan if you want)

The span on the x-axis is the amount of time spent in a function, but not the passage of time left-to-right.

I down voted you because I'm on a phone and my thumb is a bit bigger than the voting triangles - apologies.

Thank you. Very succinct explanation. I like that.

I love how the commit day is the same as the last one -- January 6.

I'll be damned if C doesn't look like arcane magic to me, I can grok some/most of it but fitting it all in my head would take a herculean effort.

Maybe it's system's programming but either way it makes my brain melt.

C itself is fairly straight forward.

The complications comes from all the variables and functions that come and go, and may have different meaning within different programs.

Then again you see the same with natural languages, and the existence of dictionaries.

Far be it from the power of my single, small protesting voice to change the tide of a culture, but I wish we could discontinue the use of the word grok. The sound is aesthetically offensive somehow, and yet adds nothing to the synonyms: comprehend or understand.

Its proponents claim it implies a /complete/ understanding, so is more specific. Yet "I understand" does not imply an incomplete understanding. Furthermore the implication of completeness is a weak one, this is proven by how quickly and easily even that small value is neutralized when, for example, the parent said, "I can grok some/most of it." If we should take this to mean, "I can completely and comprehensively understand some or most of it," is that meaningful or truly the parent's intent? Even if it were, does it add to, "I can understand some or most of it"?

I would speculate that the reason a word for "completely understand" hasn't already made its way into the English lexicon after hundreds of years is because it's unnecessary, and further that its use within the IT community is motivated not so much by the desire for precision in communication as by a desire to be perceived as a savvy member of the community.

There are few other things in the world that work like source code, where "understanding" isn't something you do linearly, or even hierarchically, but graphically, by exploring the connections between elements.

To grok a program, or a programming language, basically refers to having a graph of its elements and their interactions as a model in your head. "Grokking some of X" doesn't mean that you have a patchy or "blurry" graph of the whole thing; it means you have a complete graph of some subcomponents, but not all.

To put it another way: "understanding" doesn't usually imply being able to recreate the thing yourself. "Grokking" usually does. It's not an understanding you can put into words; it's an intuitive ability to "feel" the rules of the system because you've effectively mirrored the structure of the system with the structure of your synapses.

The only other things you can "grok", I think, are spoken languages (though there, we refer to "fluency"—another specialized kind of "understanding"), and the rules of games and game-like things like the tax system.

Or: to grok is to experience the original designer's intent, such that you could take over from the designer without the code changing in tone/style/quality very much. One might say, for example, that Brandon Sanderson has grokked the Wheel of Time series, while Kevin J. Anderson merely understands the Dune series. It's the difference between "seeing what they did" and "seeing what they were going for."

>"Grokking some of X" doesn't mean that you have a patchy or "blurry" graph of the whole thing; it means you have a complete graph of some subcomponents, but not all.

I would say that's the difference between "I understand some of it" and "I somewhat understand it."

Ability to recreate and grasping intent appear to be proprietary connotations.

I would argue that all understanding is, to use your term, "graphical" due to the nature of thought and the structure of our synapses.

I guess you could liken programming to Lego bricks.

When you have the programming language "groked" you do not see a loose pile of bricks, but what you can create from whats in the pile.

Ah, that's not quite what I meant by grokking a programming language. The "designer's intent" bit is important. When you grok a language, that doesn't (just) mean you now understand how to use the language; it means you now understand how to extend the language, or update the language, in a way the original designers would have done themselves if they had continued working on it.

To grok C and Unix, is to put yourself into a mindset where you would naturally come up with Go and Plan 9; and where e.g. C++ would seem, in comparison, ridiculous.

Grokking a thing doesn't mean you have to agree with the mindset of its designers; it just means you have to be capable of wielding that mindset, because it's the optimal mindset for understanding the thing itself.

The interesting thing about grokking a system is that you no longer need to attempt to "understand" the system piece-wise, because you can now guess what the designer would have provided for the problem you're trying to solve, and then just blindly "reach for it" without having to know it exists. There are quite a few times I guessed the existence of a Unix utility without having to be told about it, simply because it 'fit' the Unix philosophy to have a program with that function exist.

Instead of the lego analogy, I might go with IKEA: build enough of their furniture, and you don't have to read the manuals to put together new pieces any more. When you survey the particular parts you got out of the box, you can guess pretty accurately what the manual is going to say.

To properly grok the word "grok", you need to read "Stranger in a Strange Land" by Robert Heinlein. Quite possibly the best sci-fi book ever written.

Programmers create things because they/we can essentially compile code into action prior to writing anything (in other words, we know what the code will do). "Grok" is really the easiest way (i.e. single word) to encapsulate the idea that programmers - through the understanding of multiple underlying processes can create programs. In turn, generating movement in robots, flow of information, games, movies, etc., essentially using our understanding to affect change in reality (which Mike in Stranger in a Strange Land does with his mind).

When I think of the word "grok" I think of the following (from Stranger in a Strange Land):

Mike: "You told me, 'God made the World.'"

Jubal: "No, no! I told you that, while all these many religions said many things, most of them said, 'God made the World.' I told you that I did not grok the fullness, but that 'God' was the word that was used."

Mike: "Yes, Jubal," Mike agreed. "Word is 'God'" He added. "You grok."

Jubal: "No, I must admit I don't grok."

Mike: "You grok," Smith repeated firmly. "I am explain. I did not have the word. You grok. Anne groks. I grok. The grass under my feet groks in happy beauty. But I needed the word. The word is God."

Jubal shook his head to clear it. "Go ahead."

Mike pointed triumphantly at Jubal.

Mike: "Thou art God!"

Jubal:"Oh, Jesus H. — What have I done? Look, Mike, take it easy! Simmer down! You didn't understand me. I'm sorry. I'm very sorry! Just forget what I've been saying and we'll start over again on another day. But — "*

Mike: "Thou art God, That which groks. Anne is God. I am God. The happy grass are God, Jill groks in beauty always. Jill is God. All shaping and making and creating together — ." He croaked something in Martian and smiled.

As an aside, I loved that book so much I went on to read every Robert Heinlein book. Some were disappointing, but I enjoyed most of them.

Although, Time Enough for Love is probably my favorite sci-fi book, slightly ahead of with Stranger in a Strange Land.

Thou art exaggerating.

I, for one, like it because it's only one syllable, but it's obvious that brevity isn't of importance to you :)

I don't like it very much either. Not that I mind its usage, but usually I see it as unnecessary. Also, "grok" in my native language is the sound that pigs make, so it doesn't have a very nice ring to it either :)

I was surprised you weren't Swedish until I saw you're from California. Is this something that's growing in CA? I've seen this more often recently... how simple words are being offensive for various reasons. Usually followed by "ableist" and other English words I haven't heard of.

tl;dr fun is verboten

sendfile(1) was taken from Microsoft Windows.

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact