The Birth of Study Group 14 - Nicolas Guillemot, Sean Middleditch, Michael Wong - CppCon 2015
The Birth of Study Group 14 - Nicolas Guillemot, Sean Middleditch, Michael Wong - CppCon 2015
The Birth of Study Group 14 - Nicolas Guillemot, Sean Middleditch, Michael Wong - CppCon 2015
@nlguillemot @stmiddleditch
http://wongmichael.com
http://seanmiddleditch.com
1. About SG14
5. Current Efforts
6. The Future
Among the top users of C++!
http://blog.jetbrains.com/clion/2015/07/infographics-cpp-facts-before-clion/
1. About SG14
5. Current Efforts
6. The Future
The Breaking Wave: N4456
CppCon 2014
SG14
Game Dev & Standard C++
The Industry
Low Latency Committee
Interactive Simulation
Simulation and
Training Software
Real-time Graphics
Video Games
Low Latency
Finance/Trading
Computation
Constrained
Embedded Systems
Resources
Where We Are
• Google Groups
• https://groups.google.com/a/isocpp.org/forum/?fromgroups#!forum/sg14
• GitHub
• https://github.com/WG21-SG14/SG14
• Created by Guy Davidson
1. About SG14
5. Current Efforts
6. The Future
Memory Usage
• Fixed memory budgets
• 100’s of MB to a couple GB
• Virtual functions
• Less important these days, but still worth noting
• Poor inlining
• C++ abstractions not always as free as we are taught to believe
• Exceptions
• Restrict some optimizations for unwinding
Exceptions & RTTI
• Games often use -fno-exceptions and -fno-rtti
• Some important platforms don’t support exceptions reliably or at all
5. Current Efforts
6. The Future
Memory budgets
• Content creator and production focus
• Artists, designers, distribution/publishing/QA
• Let them answer questions of memory budget on their own (programmers’ time is expensive
and precious)
• Capture memory stats in the middle of a 3-hour test session without expensive
or slow instrumentation
• Need finely-grained accounting and budgeting
Example: Custom Allocators
// pseudo-code for allocator declaration similar to many engines
DEFINE_ALLOCATOR(MeshData, "Graphics/Meshes");
DEFINE_ALLOCATOR(Enemies, "GameObjects/Characters/NPCs/Enemies");
// class-based allocators
class VertexMesh {
USE_ALLOCATOR(MeshData);
};
Time
1. About SG14
5. Current Efforts
6. The Future
Long Compilation Times
• Template/include bloat
• std::unique_ptr/std::array vs C pointer/array
• <memory> over 2 KLOC in VC14 (+ dependencies)
https://xkcd.com/303/
Long Loading Times
• Long level loading impacts productivity
• Loading takes much longer in debug modes
5. Current Efforts
6. The Future
Fixed-point Numbers Precision of screen coordinates
(not actual precision, just example visualization)
• Example uses:
• Platforms slow at floating point (eg: no FPU present)
• Uniform precision (as opposed to float’s varying precision)
fixed point
• Proposed:
• std::fixed_point<Repr,Exponent>
• std::make_fixed<IntegerBits, FractionBits>
• std::unstable_remove
• https://github.com/WG21-SG14/SG14/blob/master/Docs/Proposals/unstable_remove.html
4 9
3 4 6 7 9
3 6
Thread-safe STL
• Early draft paper presented by Brett Searles
• Outlines a desire to investigate concurrency-related STL improvements
• Encouraged to further refine the paper for group discussion
Thread Stack Size
• Patrice Roy proposal
• http://h-deb.clg.qc.ca/WG21/SG14/thread_ctor_stack_size.pdf
• Requirement in embedded and games to control stack size for new threads
• Stack sizes cannot be modified after a thread is created
• std::thread::native_handle() doesn’t help
• Presented case for making the request exact, not just suggested minimum
• Embedded really needs to control memory budget
• Group discussed the ramifications of the problem and whether it was a real
issue affecting the community
• Very initial brainstorming for possible ways of addressing the problem
Related Work
• Coroutines
• N4499 by Gor Nishanov and Daveed Vandevoorde
5. Current Efforts
6. The Future
Other Current Work
• These items to be discussed before position paper is written
• plf::colony and plf::stack
• Matthew Bentley
• Intrusive Containers
• Hal Finkel
• GPU/Accelerator support
• Michael Wong, Nicolas Guillemot
Future Directions
• New containers and algorithms
• New standard algorithms like radix sort
• Miscellaneous issues
• Separate bloated headers like <algorithm>
• Investigating the overhead and workarounds for exceptions and RTTI
What next?
• This is where you come in!
• Investigate pain points, study design space
• https://groups.google.com/a/isocpp.org/forum/#!forum/sg14
• SG14 meeting at GDC
Nicolas Guillemot
Michael Wong
[email protected]