MediaWiki API result
This is the HTML representation of the JSON format. HTML is good for debugging, but is unsuitable for application use.
Specify the format parameter to change the output format. To see the non-HTML representation of the JSON format, set format=json.
See the complete documentation, or the API help for more information.
{ "compare": { "fromid": 1, "fromrevid": 1, "fromns": 0, "fromtitle": "Main Page", "toid": 2, "torevid": 2, "tons": 0, "totitle": "Entity Database/Component Storage", "*": "<tr><td colspan=\"2\" class=\"diff-lineno\" id=\"mw-diff-left-l1\" >Line 1:</td>\n<td colspan=\"2\" class=\"diff-lineno\">Line 1:</td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\"><strong>MediaWiki has been installed.</strong></del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">== Component Type Records ==</ins></div></td></tr>\n<tr><td class='diff-marker'>\u00a0</td><td class='diff-context'></td><td class='diff-marker'>\u00a0</td><td class='diff-context'></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">Consult the [https://www.mediawiki.org/wiki/Special:MyLanguage/Help:Contents User's Guide] for information on using the wiki software.</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">=== Criteria ===</ins></div></td></tr>\n<tr><td class='diff-marker'>\u00a0</td><td class='diff-context'></td><td class='diff-marker'>\u00a0</td><td class='diff-context'></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div>== <del class=\"diffchange diffchange-inline\">Getting started </del>==</div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">* Memory usage</ins></div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* [https:/</del>/<del class=\"diffchange diffchange-inline\">www</del>.<del class=\"diffchange diffchange-inline\">mediawiki.org/wiki/Special</del>:<del class=\"diffchange diffchange-inline\">MyLanguage</del>/<del class=\"diffchange diffchange-inline\">Manual</del>:<del class=\"diffchange diffchange-inline\">Configuration_settings Configuration settings list]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">* Query and filtering efficiency</ins></div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* [https</del>:/<del class=\"diffchange diffchange-inline\">/www</del>.<del class=\"diffchange diffchange-inline\">mediawiki</del>.<del class=\"diffchange diffchange-inline\">org</del>/<del class=\"diffchange diffchange-inline\">wiki</del>/<del class=\"diffchange diffchange-inline\">Special</del>:<del class=\"diffchange diffchange-inline\">MyLanguage</del>/<del class=\"diffchange diffchange-inline\">Manual:FAQ MediaWiki FAQ]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">* Maximum number of component types</ins></div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* [https:/</del>/<del class=\"diffchange diffchange-inline\">lists</del>.<del class=\"diffchange diffchange-inline\">wikimedia</del>.<del class=\"diffchange diffchange-inline\">org</del>/<del class=\"diffchange diffchange-inline\">mailman</del>/<del class=\"diffchange diffchange-inline\">listinfo</del>/<del class=\"diffchange diffchange-inline\">mediawiki</del>-<del class=\"diffchange diffchange-inline\">announce MediaWiki release mailing list]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* [https</del>:<del class=\"diffchange diffchange-inline\">//www</del>.<del class=\"diffchange diffchange-inline\">mediawiki</del>.<del class=\"diffchange diffchange-inline\">org/wiki/Special:MyLanguage/Localisation#Translation_resources Localise MediaWiki </del>for <del class=\"diffchange diffchange-inline\">your language]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div>==<ins class=\"diffchange diffchange-inline\">= Container-based Approach =</ins>==</div></td></tr>\n<tr><td class='diff-marker'>\u2212</td><td class='diff-deletedline'><div><del class=\"diffchange diffchange-inline\">* [https://www</del>.<del class=\"diffchange diffchange-inline\">mediawiki</del>.<del class=\"diffchange diffchange-inline\">org/wiki/Special:MyLanguage/Manual:Combating_spam Learn how to combat spam on your wiki]</del></div></td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">If the entity is treated as a bag of components, a natural way of storing the components is putting them in a bag-like container such as a hashmap. The components are indexed by their <code>typeid<</ins>/<ins class=\"diffchange diffchange-inline\">code>s and typically live together with the type info in the same hashmap</ins>.</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Memory Usage ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">In this approach, each component demands one <code>std:</ins>:<ins class=\"diffchange diffchange-inline\">type_index<</ins>/<ins class=\"diffchange diffchange-inline\">code> for the type identification. This wrapper class around <code>std</ins>::<ins class=\"diffchange diffchange-inline\">type_info<</ins>/<ins class=\"diffchange diffchange-inline\">code> is typically composed of a pointer to the latter, therefore requires at least 64 bits on a 64-bit machine</ins>. <ins class=\"diffchange diffchange-inline\">The total memory usage should also include that demanded by the hashmap</ins>.</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Efficiency ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Determination of the existence of a particular component type is done by first calling <code>typeid(T)<</ins>/<ins class=\"diffchange diffchange-inline\">code>, where <code>T<</ins>/<ins class=\"diffchange diffchange-inline\">code> is the type of the component. This is usually done during compilation so the actual cost only happen during queries. The result <code>std</ins>:<ins class=\"diffchange diffchange-inline\">:type_info<</ins>/<ins class=\"diffchange diffchange-inline\">code> is then hashed and queried with the hashmap to see whether it presents in the container. To query multiple types of components, the query must be done linearly to the number of component types.</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Maximum number of component types ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">As long as the memory is adequate, the hashmap can store any number of components.</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">=== Bitmask Approach ===</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">A compact way to track the presenting types of components is using a bitmask with one bit for each type of component. This approach is obviously faster than querying with <code>typeid<</ins>/<ins class=\"diffchange diffchange-inline\">code> but poses an visible limitation that the maximum numbers of component types must be known during compilation assuming that the length of the bitmask is fixed</ins>. <ins class=\"diffchange diffchange-inline\">Another problem is the assignment of bits to each type of component, which may require some compilation units to know all the types of components in order to generate consistent bitmasks</ins>.</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Memory Usage ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">This representation is quite compact and uses a fixed amount of memory for each entity decided by the maximum number of component types. The size is usually <math>\\ceil{NumMaxComponents</ins>/<ins class=\"diffchange diffchange-inline\">64} * (64 </ins>/ <ins class=\"diffchange diffchange-inline\">8)}<</ins>/<ins class=\"diffchange diffchange-inline\">math> on 64</ins>-<ins class=\"diffchange diffchange-inline\">bit machines.</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Efficiency ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">Testing the existence of a particular component type is done in three steps</ins>: <ins class=\"diffchange diffchange-inline\">getting its bit position, build the bitmask representing its existence, test with the entity's bitmask</ins>. <ins class=\"diffchange diffchange-inline\">This is usually done in several instructions depending on the length of the bitmask, but always has the same cost</ins>. <ins class=\"diffchange diffchange-inline\">Querying for multiple types involving performing the first two steps </ins>for <ins class=\"diffchange diffchange-inline\">each type and using logical OR to build the logical disjunction mask. The building of testing mask is usually done during compilation, so the actual cost only consist of testing with the entity's bit mask.</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">==== Maximum number of component types ====</ins></div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div>\u00a0</div></td></tr>\n<tr><td colspan=\"2\">\u00a0</td><td class='diff-marker'>+</td><td class='diff-addedline'><div><ins class=\"diffchange diffchange-inline\">The length of the bitmask limits the number of component types can be used in the system</ins>. <ins class=\"diffchange diffchange-inline\">Since increasing its size also increases the memory usage and reduces performance, it demands a careful design of components and systems to make the application efficient, which might not be a bad thing after all</ins>.</div></td></tr>\n" } }