qemu-e2k/docs
Eric Blake f545504420 qapi-introspect: Document lack of sorting
qapi-code-gen.txt already claims that types, commands, and
events share a common namespace; set this in stone by further
documenting that our introspection output will never have
collisions with the same name tied to more than one meta-type.

Our largest QMP enum currently has 125 values, our largest
object type has 27 members, and the mean for each is less than
10.  These sizes are small enough that the per-element overhead
of O(log n) binary searching probably outweighs the speed
possible with direct O(n) linear searching (a better algorithm
with more overhead will only beat a leaner naive algorithm only
as you scale to larger input sizes).

Arguably, the overall SchemaInfo array could be sorted by name;
there, we currently have 531 entities, large enough for a binary
search to be faster than linear.  However, remember that we have
mutually-recursive types, which means there is no topological
ordering that will allow clients to learn all information about
that type in a single linear pass; thus clients will want to do
random access over the data, and they will probably read the
introspection output into a hashtable for O(1) lookup rather
than O(log n) binary searching, at which point, pre-sorting our
introspection output doesn't help the client.

It doesn't help that sorting can be subjective if you introduce
locales into the mix (I'm not experienced enough with Python
to know for sure, but at least it looks like it defaults to
sorting in the C locale even when run under a different locale).
And while our current introspection output is deterministic
(because we visit entities in a sorted order), we may want
to change that order in the future (such as using OrderedDict
to stick to .json declaration order).

For these reasons, we simply document that clients should not
rely on any particular order of items in introspection output.
And since it is now a documented part of the contract, we have
the freedom to later rearrange output if needed, without
worrying about breaking well-written clients.

Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1446791754-23823-13-git-send-email-eblake@redhat.com>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-11-10 08:10:28 +01:00
..
specs ivshmem: use little-endian int64_t for the protocol 2015-10-26 10:19:53 +01:00
aio_notify_accept.promela AioContext: optimize clearing the EventNotifier 2015-07-22 12:41:40 +01:00
aio_notify_bug.promela AioContext: fix broken placement of event_notifier_test_and_clear 2015-07-22 12:41:40 +01:00
aio_notify.promela AioContext: fix broken ctx->dispatching optimization 2015-07-22 12:41:40 +01:00
atomics.txt docs/atomics.txt: fix two typos 2015-04-30 16:05:48 +03:00
bitmaps.md qapi: Rename 'dirty-bitmap' mode to 'incremental' 2015-07-02 09:20:18 +01:00
blkdebug.txt block: Rename BlockDriverCompletionFunc to BlockCompletionFunc 2014-10-20 13:41:27 +02:00
blkverify.txt
bootindex.txt Typo, spelling and grammatical fixes 2013-04-12 14:33:20 +02:00
build-system.txt docs: describe the QEMU build system structure / design 2015-09-25 12:20:18 +02:00
ccid.txt libcacard: improve documentation 2014-06-10 07:44:01 +02:00
ich9-ehci-uhci.cfg
image-fuzzer.txt docs: List all image elements currently supported by the fuzzer 2014-09-22 11:39:35 +01:00
live-block-ops.txt
memory-hotplug.txt docs: update documentation for memory hot unplug 2015-04-27 21:07:38 +02:00
memory.txt docs: clarify memory region lifecycle 2015-02-16 17:30:19 +01:00
migration.txt migration: Use normal VMStateDescriptions for Subsections 2015-06-12 06:53:57 +02:00
multi-thread-compression.txt docs: Add a doc about multiple thread compression 2015-05-06 17:36:57 +02:00
multiple-iothreads.txt docs/multiple-iothreads.txt: add documentation on IOThread programming 2014-08-15 15:07:13 +02:00
multiseat.txt maint: remove / fix many doubled words 2015-09-11 10:21:38 +03:00
pci_expander_bridge.txt docs: Add PXB documentation 2015-06-03 18:19:19 +02:00
q35-chipset.cfg q35: Add PCIe switch to example q35 configuration 2013-08-21 12:39:15 +03:00
qapi-code-gen.txt qapi-introspect: Document lack of sorting 2015-11-10 08:10:28 +01:00
qcow2-cache.txt docs: document how to configure the qcow2 L2/refcount caches 2015-09-04 21:00:32 +02:00
qdev-device-use.txt
qemupciserial.inf Docs: Introduce multiport serial support in qemupciserial.inf. 2014-03-12 10:33:23 +01:00
qmp-events.txt docs: Document QMP event rate limiting 2015-10-30 09:05:38 +01:00
qmp-intro.txt docs: Move files from docs/qmp/ to docs/ 2015-10-12 18:44:53 +02:00
qmp-spec.txt docs: Document QMP event rate limiting 2015-10-30 09:05:38 +01:00
rcu.txt doc/rcu: fix g_free_rcu() usage example 2015-10-19 10:13:07 +02:00
rdma.txt rdma: Fix incorrect description in comments 2014-09-20 17:55:53 +04:00
replay.txt replay: global variables and function stubs 2015-11-05 12:19:08 +01:00
spice-port-fqdn.txt docs: add spice-port-fqdn.txt 2012-12-17 14:01:41 +01:00
tracing.txt docs: update the usage example of "dtrace" backend in tracing.txt 2015-10-09 10:14:05 +01:00
usb2.txt usb: update docs for bus name change 2013-04-03 11:39:43 +02:00
usb-storage.txt Fix typos and misspellings 2013-03-22 13:25:07 +01:00
virtio-balloon-stats.txt virtio-balloon: return empty data when no stats are available 2014-05-25 12:46:58 +03:00
virtio-migration.txt virtio: add some migration doc 2015-10-22 14:34:48 +03:00
vnc-ledstate-Pseudo-encoding.txt doc: document the Pseudo-encoding of LED state 2013-04-29 08:28:51 -05:00
win32-qemu-event.promela qemu-thread: add a fast path to the Win32 QemuEvent 2015-09-24 20:52:28 +02:00
writing-qmp-commands.txt qapi: Rename qmp_marshal_input_FOO() to qmp_marshal_FOO() 2015-09-21 09:56:48 +02:00
xbzrle.txt xbzrle: optimize XBZRLE to decrease the cache misses 2015-01-15 17:49:43 +05:30
xen-save-devices-state.txt