Optimize KxmlParser.

I benchmarked this on four files:

  size file
   268 rhapsody authorization
 29489 picasa sync (for gallery)
101129 amazon mp3 search results
103855 RSS feed

The performance regressed for the 268-byte file from 1.44ms to 1.56ms.
Small files are important and I intend to follow-up to bring this back
into line.

For the other files, the improvements for pull parsing were 22%, 34% and 29%.
Improvements for DOM parsing were 17%, 23% and 21%.

All but the 268-byte document now parse faster with Kxml than with Expat.

                            101129 byte amazon mp3 search results    29489 byte picasa sync dat             268 byte rhapsody authentication        103855 byte RSS feed
benchmark             run      us linear runtime                       us linear runtime                     us linear runtime                       us linear runtime
      Dom ready to commit 174,580 ========================         40,964 =======================         1,968 ===========================     130,814 =======================
      Dom        baseline 210,256 ==============================   53,227 ==============================  2,183 ==============================  164,708 =============================
ExpatPull ready to commit 129,776 ==================               21,621 ============                      734 ==========                       86,799 ===============
ExpatPull        baseline 130,078 ==================               21,700 ============                      759 ==========                       85,578 ===============
 KxmlPull ready to commit  88,716 ============                     20,578 ===========                     1,560 =====================            58,567 ==========
 KxmlPull        baseline 114,317 ================                 31,040 =================               1,443 ===================              82,478 ===============

Change-Id: I98b7f979c2f926e25c72541bf9f5036f097e8d91
http://b/3090550
3 files changed