Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You are using the Split methode to split your points:</p> <pre><code>string[] splitXYZ = pntText.Split(new string[] { args[1] }, StringSplitOptions.None); </code></pre> <p>Having this in the for loop isnt really performant, since it allocates memory for the returned array object and a String object for each array element. Consider using the IndexOf combinied with Substring, im not sure how faster is it you will have to test this.</p> <p>Read <a href="http://msdn.microsoft.com/en-us/library/tabh47cf.aspx" rel="nofollow">Documentation</a> about this issue:</p> <blockquote> <p><strong>Performance Considerations</strong> </p> <p>The Split methods allocate memory for the returned array object and a String object for each array element. If your application requires optimal performance or if managing memory allocation is critical in your application, consider using the IndexOf or IndexOfAny method, and optionally the Compare method, to locate a substring within a string. </p> <p>If you are splitting a string at a separator character, use the IndexOf or IndexOfAny method to locate a separator character in the string. If you are splitting a string at a separator string, use the IndexOf or IndexOfAny method to locate the first character of the separator string. Then use the Compare method to determine whether the characters after that first character are equal to the remaining characters of the separator string.</p> </blockquote> <p>Another point is that you are creating an object (Vector) for each returned points array including 3 times the Parse part, which costs some performance too:</p> <pre><code>Vector3 ve2 = new Vector3(float.Parse(splitXYZ[0]), float.Parse(splitXYZ[1]), float.Parse(splitXYZ[2])); </code></pre> <p>If this isnt really needed at this point (depends on your needs) you can keep the information in form of text or even a struct and create the Vector object once you need to process it at later point.</p> <p>Hope this helps</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload