3.6.2 String comparison and hashing

When an instance receives an incoming function call, in other words a request, it must first look up the function by name.

In U64JSON, all strings are sequences of 64-bit values. They have several properties that implementations can exploit to make function lookup more efficient:

  • The first 64-bit value contains the first 7 characters and the length of the string.
  • Most strings in Iris can be encoded using 1-6 uint64_t values, and most Iris function names can be encoded using 1-4 uint64_t values. It is possible to write explicit code for these four cases instead of using a generic loop.
  • If the first 64-bit values of two strings are different, the two strings are different.
  • If the first 64-bit values of two strings are the same, they are guaranteed not to be a prefix of each other, or the two strings are the same.

It is often possible to implement a function lookup that does not check for unknown functions in constant time by using closed hashing on the first 64-bit value and comparison of the second 64-bit value only if necessary. Checking for unknown functions can be a runtime option which then uses a slower decoder (debug mode).

Non-ConfidentialPDF file icon PDF version101196_0100_03_en
Copyright © 2018, 2019 Arm Limited or its affiliates. All rights reserved.