title: IntelliJ very slow update when using json builder for large object
body: <p>I'm using Elasticsearch's <code>XContentBuilder</code> to create a JSON representation of a document type mapping:</p>
  
  <pre><code>XContentBuilder mapping = XContentFactory.jsonBuilder();
  mapping.startObject()
      .startObject("someType")
          .startObject("_ttl")
              .field("enabled", true).field("default", "90d")
          .endObject()
          //... and so forth. The full declaration is about 100 lines long.
  </code></pre>
  
  <p>The mapping is moderately sized-- there are about 30 <code>.startObject()</code> calls and 60 <code>.field()</code> calls in total.</p>
  
  <p>Declaring this <code>mapping</code> object causes Intellij to respond very slowly with syntax highlighting/error-checking. If I type <code>int x = "";</code> anywhere within the <strong>same file</strong>, it takes about 20 seconds for the IDE to highlight the line as erroneous. If I reduce my <code>mapping</code> object to about half the size, it still takes the IDE 4 seconds to respond, compared to the normal sub-second responsiveness. Note that the automatic project make process (I selected "Make project automatically" under IntelliJ settings) performs at the normal speed.</p>
  
  <p>Is this a "bug" of IntelliJ, or are factory methods not meant to be chained so extensively? Breaking up the chain into many smaller calls solves the issue, but is there a better way?</p>
  
  <p><strong>Additional Info:</strong></p>
  
  <p>Using IntelliJ 15.0.2 Ultimate edition</p>
  
  <p>Windows 7, 64-bit, 8GB RAM, Core i5-4430 (quad core) @ 3.00GHz</p>
  
  <p>Running 2 VMs and Eclipse IDE on the side and never had a performance problem</p>