 class SuggestionListElement extends HTMLElement
   maxItems: 200
   emptySnippetGroupRegex: /(\$\{\d+\:\})|(\$\{\d+\})|(\$\d+)/ig
+  nodePool: null
 
   createdCallback: ->
     @subscriptions = new CompositeDisposable
     @classList.add('popover-list', 'select-list', 'autocomplete-suggestion-list')
     @registerMouseHandling()
     @snippetParser = new SnippetParser
+    @nodePool = []
 
   attachedCallback: ->
     # TODO: Fix overlay decorator to in atom to apply class attribute correctly, then move this to overlay creation point.

    else
      @descriptionContainer.style.display = 'none'

  itemsChanged: -> @render()

  render: ->
    @selectedIndex = 0

  renderItem: ({iconHTML, type, snippet, text, displayText, className, replacementPrefix, leftLabel, leftLabelHTML, rightLabel, rightLabelHTML}, index) ->
    li = @ol.childNodes[index]
    unless li
      if @nodePool.length > 0
        li = @nodePool.pop()
      else
        li = document.createElement('li')
        li.innerHTML = ItemTemplate
      li.dataset.index = index
      @ol.appendChild(li)

