सभी किताबें

पेशेवर

1 Markets I: The Ecosystem and Exchange-Traded Marketsबाज़ार ऑनलाइन 2 Markets II: Rates, FX and Creditबाज़ार ऑनलाइन 3 Markets III: Commodities, Energy and Cryptoबाज़ार ऑनलाइन 4 Quantitative Methodsविधियाँ ऑनलाइन 5 Derivatives and Volatilityडेरिवेटिव्स ऑनलाइन 6 Rates, Credit, XVA and Riskब्याज दरें, क्रेडिट और जोखिम ऑनलाइन 7 Research Craft: Predictors, Backtests, Measurement, Portfoliosअनुसंधान ऑनलाइन 8 Strategies I: Equities and Futuresरणनीतियाँ ऑनलाइन 9 Strategies II: Volatility, Relative Value, Macro and the Bank Desksरणनीतियाँ ऑनलाइन 10 Microstructure and Executionनिष्पादन ऑनलाइन 11 Market Making and High-Frequency Tradingमार्केट मेकिंग ऑनलाइन 12 Machine Learning for Marketsमशीन लर्निंग ऑनलाइन 13 Low-Latency Softwareतकनीक ऑनलाइन 14 Networks, Hardware and Trading Infrastructureतकनीक ऑनलाइन 15 Research, Data and Risk Platformsतकनीक ऑनलाइन 16 The Desk and the Firmफ़र्म ऑनलाइन 17 The Industry: Firms, Roles and Careersकरियर ऑनलाइन 18 Interviews I: Maths, Probability and Speedकरियर ऑनलाइन 19 Interviews II: Markets, Trading Games and the Final Roundकरियर ऑनलाइन 20 Interviews III: Codeकरियर ऑनलाइन
ऐप्स परिचय Coach लॉग इन पढ़ना शुरू करें

Quantitative Finance · शब्दावली

Structure padding क्या है?

Definition 6.1 Low-Latency Software · अध्याय 6 — C++ for Latency I: Memory

Every scalar type has an alignment, equal to its size on x86-64 (a double starts at a multiple of 8). The compiler lays out a structure’s fields in declaration order and inserts structure padding, unused bytes, before any field that would otherwise be misaligned and at the end, so that the structure’s size is a multiple of its largest alignment.

The order of  laid out byte by byte: the first draft carries 17 bytes of padding (grey) in 40; the same fields sorted by size need 24, with the side, flag and time in force in the three bytes after the quantity.
Figure 6.1. The order of Example 6.2 laid out byte by byte: the first draft carries 17 bytes of padding (grey) in 40; the same fields sorted by size need 24, with the side, flag and time in force in the three bytes after the quantity.

उदाहरण

Example 6.2 (Ordering fields)

An order written as a first draft declares a char side, a double price, a char flag, a 64-bit id, a 32-bit quantity and a char time in force: 23 bytes of data in 40 bytes, 17 of them padding. Ordered by size (id, price, quantity, then the three characters) the same fields take 24 bytes: eight orders occupy three 64-byte cache lines instead of five. The compiler will not reorder fields itself: the order is part of the type’s interface.

अध्याय में पढ़ें →