title: Slow iteration through a JSONArray in GWT
body: <p>I'm using GWT to build an application, and I'm facing serious speed issues with something that I thought would be pretty fast. I have a JSONObject with data in the following structure (but that is much larger):</p>
  
  <pre><code>{"nodeData" : [ 
                  { "name":"one", "attributes":["uno","dos"]}, 
                  {"name":"two", "attributes":["tres"]}
                ]
  }
  </code></pre>
  
  <p>I am trying to iterate through the JSON object to store all the attributes into an arraylist which every node object has, with attribute sizes ranging from 4 to 800.</p>
  
  <pre><code>JSONObject JSONnode = nodeData.get(i).isObject();
  Node node = new Node(JSONnode.get("name").toString();
  JSONArray attributeArray = JSONnode.get("Attributes").isArray();
  int attributeSize = attributeArray.size();
  
  
  for(int j = 0; k &lt; attributeSize; j++){
      node.attributeArrayList.add(attributeArray.get(j).toString();
  }
  </code></pre>
  
  <p>The for loop I'm executing is taking about a minute, which seems too long, and I'm not sure how to improve it. The minute is in development mode, but I don't know if it would be any faster when I compile it.</p>