Electronic Arts Standard Template Library for C++ Open Sourced
github.com
github.com
However, this is certainly interesting because the emphasis on speed (and thus also on simplicity) is what I'm sometimes missing in the real STL or in Boost. That's exactly what you need in a game but also in much other performance critical code.
As far as I remember, Chrome has used the STL earlier. But I looked now and I see this: https://chromium.googlesource.com/chromium/blink/+/master/So...
Gecko also seem to have a lot of custom stuff: https://github.com/mozilla/gecko-dev/tree/master/xpcom/strin...
Doom3 idLib: https://github.com/id-Software/DOOM-3-BFG/tree/master/neo/id...
Unreal engine: https://answers.unrealengine.com/questions/2695/rocket-and-t...
You'll find much more similar libs when you search in some of the big games.
Edit: From a look at the source it definitely at least has some extra map classes for more specialized uses.
std_sort_time: 0.08805380923877237s (11.908354778344838 M keys/s)
eastl_sort_time: 0.07010223707038676s (14.957810817751337 M keys/s)
EA's sort seems to respond better to full program optimisation than std::sort. Platform: vs2012 x64, i7 CPU.
The famous maxim about how much cleverer you have to be to debug code than to write it always applies! No need to make things worse by forcing yourself to debug the optimized build.
The WTF (Web Template Framework) is actually inherited from WebKit and used in the core rendering engine. I'm not sure how widely it's used in the Google parts of Chromium.
> Gecko also seem to have a lot of custom stuff
That's the old XPCOM stuff. While those string types continue to get a lot of use, the closest analogue to the STL is MFBT: https://github.com/mozilla/gecko-dev/tree/master/mfbt
I've never had a problem shipping 60hz games with STL even on consoles.
It's just on Github now.
Why does "swap" use EASTL/move_help.h? There are things that can go wrong with a move that can't go wrong with a swap. Move is a swap with a constraint that the destination be empty.
(Doing things through swapping has its uses. It preserves single ownership, for example.)
This. I work almost exclusively with game programmers and it can be ... difficult at times. They seem to be largely unaware of the larger computer science community that's existed since the mid sixties, often "discovering" things that were solved by the science years ago.
I do agree that the apps and server world is ahead, in many cases way ahead, in terms of effective development practices and programming languages. But we've lost sight of how to get performance out of the hardware.
I know some ML and HPC cats who obsess about hitting peak gigaflops...
Still, app and server developers, by and large, have not been able to do this (and I count myself among them!) We use languages with no support for SIMD, we stick to language implementations without optimizing compilers, single-threaded language implementations are very popular, we ignore GPU computing despite the fact that the die space reserved for the GPU is as large or larger than the die space reserved for the CPU cores nowadays, and so on.
Cilk http://supertech.lcs.mit.edu/cilk/
ParaSail http://www.embedded.com/design/other/4375616/ParaSail--Less-...
Lime Compilation http://researcher.watson.ibm.com/researcher/files/us-bacon/D...
Chapel http://chapel.cray.com/overview.html
Triolet http://impact.crhc.illinois.edu/shared/Papers/dissertation-r...
Big-budget video games often have very different feature requirements compared to ofter types of software, not to mention especially strict deadlines, so their attitudes towards shipping products is going to be different.
Designing any soft realtime application is subtly different from traditional application. Your frametime budget is 16ms. It's rock solid. You spend 17ms and you're down to 30fps and you could've just spent 33ms.
That's actually the reason why garbage collection is big no no in games. One cannot afford even 1ms gc pauses. And in server world that's considered blazingly fast. If a game is for some reason developed using a language with GC it's just skipped by making object pools. And then tediously checking that no allocations and freeing actually happens during a frame.
Is there actually any constraint here? I thought the only constraint on a moved-from object is that you can't use it in the current state.
namespace NS {
struct S {
friend void swap(S& a, S& b) {
// do something interesting here
}
};
}
// later..
template<typename T>
void f(T& a, T& b) {
using std::swap;
swap(a, b); // calls NS::swap(a, b) if T = NS::S
}There is some issue with duplicates in HN, I think points should go to the original poster, more if it's recent.