Live data from Hacker News

Electronic Arts Standard Template Library for C++ Open Sourced

github.com

21–30 of 60 posts

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#21

STL is maybe a bit missleading because it doesn't seem like it is a drop-in replacement for the STL. 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…

What parts of the EASTL are faster than the normal STL? Does it have better maps? Edit: From a look at the source it definitely at least has some extra map classes for more specialized uses.

I measured the sort to be slightly faster: https://www.reddit.com/r/programming/comments/451yje/ea_open...

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#22
Cute. It's fun to see game programmer code. This is really C with a little C++. Lots of pointer casts, comments like "The user must provide ample buffer space, preferably 256 chars or more." There's a lot of stuff in there to deal with Microsoft Visual C++'s interpretation of the language, which prior to 2010, was kind of off.

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.)

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#23
post #22

Cute. It's fun to see game programmer code. This is really C with a little C++. Lots of pointer casts, comments like "The user must provide ample buffer space, preferably 256 chars or more." There's a lot of stuff in there to deal with Microsoft Visual C++'s interpretation of the language, which prior to 2010, was kind of off. Why does "swap" use EASTL/move_help.h? There are things that can go wrong with a move that…

> Cute. It's fun to see game programmer code.

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.

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#24
post #17

Now we can at least explain with code examples why Electronic Arts Games suck so much.

That's a pretty low punch under the belt. If you are being serious, please give some examples of why this STL sucks. Corporations like EA, which is a long hauled bureaucratic labyrinth should be celebrated for open sourcing code.

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#25

STL is maybe a bit missleading because it doesn't seem like it is a drop-in replacement for the STL. 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…

Chromium uses STL, WebKit (forked to Blink) uses custom stuff.

I've never had a problem shipping 60hz games with STL even on consoles.

Re: Electronic Arts Standard Template Library for C++ Open Sourced

#26

STL is maybe a bit missleading because it doesn't seem like it is a drop-in replacement for the STL. 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…

What parts of the EASTL are faster than the normal STL? Does it have better maps? Edit: From a look at the source it definitely at least has some extra map classes for more specialized uses.

One goal of EASTL is to be faster in non-optimized builds compared to other variants. If a game is running too slow to be playable, it can become impossible to debug! This was especially a problem on consoles with no OOE. It achieves this by sacrificing a lot of encapsulation and accepting non-DRY, manually inlined function implementations.
Post reply on HN