Home Help Center

Efficiency with very long strings

myrosiamyrosia Member Myroslava DzikovskaOrganization: University of EdinburghProject: tutorial dialogue system ✭✭
I have a general efficiency question as I am thinking through my interfaces. In the process of developing my application I will be likely passing around very long strings (for example, a detailed parse tree for a 15-word sentence -- this can easily be 15,000 characters). These are represented in C++ as std::string. I am wondering how much copying would be going on, if it is likely to affect efficiency of my interfaces, and if I should plan ahead of time to do something about it.


  • matthewmatthew NL, CanadaMember Matthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine ✭✭✭
    I don't think you will have issues with 15k strings. From an Ice point of view, the network latency will be much higher than any time you spend allocating and copying strings. If you are using highly compressible data (such as strings) you might consider using protocol compression to minimize the amount of data you are sending over the network.
Sign In or Register to comment.