A large number of strings are known, which are stored in methods such as "01", "02", "0101", and "0101002" to generate correct upper-lower-level relationships. For example, the level 01 and 02 are equal, and the Level 01 is 0101002 and the level 0101 is lower. The length of the string is not fixed, and the width of each level is not fixed. Actually, the serial number of a known unit in the project generates a parent-child relationship. Vc6 is used to implement a program, and vector is used with map. The sameCodeAfter being translated into Java, we were surprised by the comparison. It takes several seconds for C ++ to implement the 2000 strings, while Java's 20 million strings are in over 2000 milliseconds, that is, more than 2 seconds! C ++ uses stlport for better performance, but far below the performance of Java!
The suspect is related to the string processing of C ++.
As a souvenir.
Later, I found the cause, and changed the vector to the reference for passing. Because I am used to Java, I just want to directly pass the vector variable. Which of the following statements does C ++ copy a copy!