Home Comments

Method tokens: strings vs. indices

JohnBatesJohnBates Member
I see from the generated c++ code that Ice appears to send the string name of a method accross the wire to invoke it. Is there a reason you're not using integer indices instead? (To save network bandwidth and allow the possibility of constant time look-up of methods.)



  • marcmarc FloridaAdministrators, ZeroC Staff Marc LaukienOrganization: ZeroC, Inc.Project: The Internet Communications Engine ZeroC Staff
    Using strings is more tolerant with respect to changes in the interfaces. It is also easier for debugging. For example, a router wouldn't know how to associate operation indexes with operation names, and therfore couldn't print any meaningful debug information.

    The overhead for strings as operation names is rather small. Usually the payload of a request dominates the transmission size, not the operation name. And the lookup is done with a sorted table, so this is not a bottleneck either.
Sign In or Register to comment.