The list example is a bit contrived too. A simple templated class for the list node could give both encapsulation and the exact same speed and allocation characteristics as the C code.
530 karma · joined March 15, 2013
The list example is a bit contrived too. A simple templated class for the list node could give both encapsulation and the exact same speed and allocation characteristics as the C code.
I do agree that being able to control precision is important, and as of yet I'm not sure the best way to implement that.
It doesn't do any js -> glsl stuff, but it is another packaging and reuse approach for GLSL
Saving creates an anonymous gist for the shadertoy, if you run into any issues please do report them with the url! It is all in early stages, so I'm sure bugs abound.
Someone, at somepoint, has to do this though. Custom memory allocators are more or less predicated on having a byte buffer you chop up and use like this.
I think the best we get -- especially in driver code -- is well thought out design that have low cost abstractions between the device details and the application logic. But that seems like a library detail more than a compiler or language one.
More substantially, if all AMA teams really are going to be running the show without official reddit support, this cuts in a couple of ways. It shows a maintained lack of faith in reddit from the moderators, and it also is going to make the logistics of AMAs more difficult. The AMAs are unique content which is a substantial draw of new users, where a ton of the work was already done by volunteers. The logistical strain is going to make for less or worse content, pick your poison. High profile guests, especially those not technically savvy, are less likely to participate without admin support being available.
Strategically, reddit almost certainly wants to be involved in this -- they want to be tightly coupled, enough that the group can't spin off their own version.
I don't think this damage is irreparable, but I do think it's going to take substantial work to fix. And I mean, don't take that from me, take it from them -- https://www.reddit.com/r/announcements/comments/3cbo4m/we_ap....
And even if I was an employee; well there are always disgruntled employees, their opinion isn't reasonable either.
These are absurd arguments. By the same logic, the CEO of whole foods could hold a press conference and just go on a racist, hateful rant, and I couldn't possibly have a meaningful opinion on their effectiveness as a CEO.
In any event, the people I meant who did have the internal data weren't employees, I meant their board of directors.
And is it possible that a CEO is really awesome, but really really unlucky, and it just _looks_ like they are bad at their job outwardly? Sure, there is some non-zero chance of this; much like there is some non-zero chance of damn near anything.
Perfect information is an impossible ideal; arguing that a rational opinion is impossible regardless of any circumstance since we don't have access to all the information which exists would imply that no person can have a rational opinion about anything, ever.
Some hires and the chilling effects thing are maybe the biggest unambiguous positive developments. The subreddit banning and the salary negotiations thing were received with mixed opinion, but even if you agree with what was banned, the handling of it was questionable and seemed very rushed.
And then there was last week, which derailed the site over a weekend and made national news outlets for the whole week. A lot of details about internal dealings came to light, and none of them particularly painted reddit in a good light. There is no plausible way the amount of good shes done in the last 10-12 months outweighed the massive damage that was inflicted.
It is also worth noting that the people who do have access to a lot of internal information about the inner workings of reddit 'mutually' agreed that she shouldn't be the CEO. Undoubtedly the backlash -- some of it misguided -- played into this, but frankly a large part of being the CEO of a community-based site is PR.
Analytics showing brigading statistics would be dead simple. It would establish a clear, objective metric and back the notion of behavior, not ideas, being targeted.
I also kind of doubt objective numbers would justify the actual banned subreddits; I think it would show a lot of other ones were just as bad or worse, but weren't so unapologetically disgusting.
Maybe I'm reading this wrong, but to me it seems like this is saying go ahead and use the fixed size variants whenever, but it is still OK to use int when you need <=32 bits.
Still, at least nowadays there is no excuse -- everything from TI to VC++ supports stdint variations.
Good spot though; I kind of doubt that this was a conscience design decision and probably just a slip up.
But yeah, some people write hateful, stupid things on the internet. It doesn't mean we can just dismiss every page with comments enabled.
Is that why we defend it? I strongly disagree with this idea. There is a lot of distasteful speech that I think we should defend, and much of it doesn't concern disenfranchised or weak groups.
I find it hard to articulate an exact reason for defending free speech. But a large part of it to me is that we grant an _enormous_ amount of power to whoever we let define what ideas and speech is allowed, and disallowed. In an ideal world, you would let free speech be the absolute rule; since truly distasteful things would be seen as such and just be noise.
Pragmatically though, free speech often has real consequences, and in some case real, actual victims and that must be balanced. But understand that if you defend free speech in any venue, you have to accept some level of speech you find distasteful. I think you get to draw the line at showing actual harm or damage to other people; and that harm needs to be more than "It hurt my feelings".
There are a thousand different ways marketing people can shove celebrities down peoples throats. If you turn AMAs into exactly that, you wont get $100M a year; you'll just ruin something kinda novel.
Not entirely clear on how the indexing would work to your benefit with parallel arrays. If there is a 1 to 1 mapping between datapoints to items in each || array, the memory consumption is the same as a struct, so I assume thats not it.
It almost sounds like you are describing a (possibly non-numeric? non-homogenous?) sparse matrix, which are usually worked with in vastly different formats for construction vs manipulation vs iterating over.
I don't get the point about additional independent properties. Size of the struct changes the memory you need to grab, but not the number of reallocs you have to do.
See: http://baptiste-wicht.com/posts/2012/12/cpp-benchmark-vector... for actual benchmarks on this. If you disagree with these benchmarks, and find your own results to be different, I'd love to see the write up on that, and I'm sure I'm not the only one.
Even then, that might be a good strategy if inserting into a vector type data structure required a realloc everytime. However, most implementations use an exponential strategy, so for a million item vector grown one at a time, you'd see only 10-20 reallocs. Which is to say, the realloc problem is only a problem in memory constrained -- think embedded or kernel -- systems where a memory overhead of 1.5-2x isn't viable.
You can do the same thing -- and some linked list implementations do -- with linked lists, where you grab a block of nodes at a time. If you don't though, just in inserts, the vector will be faster. Mallocs are non-trivial in most applications and can easily become the bottleneck.
I think the thing you might be underestimating is how much faster it is to iterate over a vector than a linked list, nevermind random access. Cache issues really, really do matter. If you want to see this in action and happen to have a SoC dev board around, disable the data cache and run some benchmarks with vectors. If you re-enable it, you will easily see a 10x-20x improvement.
If you watch https://www.youtube.com/watch?v=YQs6IC-vgmo, he goes into some of the use cases and some benchmarks that might be compelling to you.
Vectors/Arrays are great when you don't care as much about the total memory consumption, but you want to reduce the amount of heap fragmentation.
A downside to using arrays like this, and likely a leading reason you don't see them used that much in the linux kernel is that every once and a while an insert is going to force a realloc which takes a relatively long time. std::vector and the like mitigate this by reserving more space than they'll need and so they minimize the # of reallocs required.
There is also performance implications to doing std::vector<myStruct> vs std::vector<myStruct*>. The later can very easily mimic the same cache coherence issues that happen with a linked list of myStructs.
So when we are talking about speed in terms of millions of items in some data crunching program, vector is almost always going to win out. But if we are talking about minimal memory footprint where we want consistent timings , linked lists are a contender.
Relatively speaking, I don't think context switching is _that_ expensive compared to other areas you can focus on like doing smarter memory management.
I don't know exactly what they mean by threads having heavy memory overhead, but possibly they mean cache interference mentioned in that link? I'd be curious if there is an actual large memory chunk other than stack/scheduling details in play here too.
On modern cores too, there are a decent chunk of registers, including floating point registers. I've looked into timings before for embedded applications and the performance hit here isn't trivial when looking at interrupts and the like; but I'd be surprised if it was that overwhelming on servers.
2013 has a lot, and it looks like 2015 almost closes the gap. I'm content with the 2013 additions, but I simply do not understand why c99 wasn't fully supported 10 years ago, much less in the latest VS edition. C++ is better in many ways but when you need to compile C specific code, it is incredibly frustrating.
Honestly, I also think github's defacto status is a major obstacle to adoption.
There are actually projects that let you work with an hg/git repo and push to the other type. http://hg-git.github.io/ for instance. No idea if these things are production ready or not though.
The title + filetype:pdf seems to find them all.
This is very convenient in most cases, but could hide the fact that a direct recursive call will overflow your stack.
This isn't apparent and would test out ok until someone makes a small; seemingly insignificant change which the compiler can't do tail call optimization on, and all of a sudden things fail.