title: Displaying textview settext very slow performance with long text
body: <p>I try to display a long text with TextView in Android app (maximally about 300 KB) and performance on Nexus 7 is terrible (something around 10 seconds). Text is scrollable so we divided it into smaller pieces and tried to display them in ListView (using ViewHolder pattern). Performance goes up, but still scrolling animation is VERY choppy. Actually, performance with pure text is unacceptable (Nexus 7 is not the slowest device) but in the end we will use styled text (using SpannableString) which will completely kill performance.</p>
  
  <p>I show systrace screens below (links actually, sorry for that but I have no reptutation to upload pictures :)):</p>
  
  <ul>
  <li><a href="http://i62.tinypic.com/2mq57qx.png" rel="nofollow">http://i62.tinypic.com/2mq57qx.png</a></li>
  <li><a href="http://i60.tinypic.com/mbin1e.png" rel="nofollow">http://i60.tinypic.com/mbin1e.png</a></li>
  </ul>
  
  <p>I know that text rendering is non-trivial task, but iOS deals with it perfectly, so why Android can't? And is there any reasonable solution to this problem?</p>
  
  <p>Hardware acceleration is enabled.</p>
  
  <pre><code>@Override
  public View getView(final int position, View convertView, ViewGroup parent) {
      ViewHolder holder = null;
      if (convertView == null) {
          holder = new ViewHolder();
          convertView = mInflater.inflate(R.layout.element_item_layout, parent, false);
          //element_item_layout file is/contains only one TextView, as below
          holder.textView = (TextView) convertView.findViewById(R.id.element_item_textview);
          convertView.setTag(holder);
      } else {
          holder = (ViewHolder)convertView.getTag();
      }
  
      holder.textView.setText(getItem(position).longText);
  
      return convertView;
  }
  
  private class ViewHolder {
      public TextView textView;
  }
  </code></pre>