Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 704971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:00:05+00:00 2026-05-14T04:00:05+00:00

Has anyone seen or compiled benchmarks comparing declarative (XML) versus programmatically created UI’s in

  • 0

Has anyone seen or compiled benchmarks comparing declarative (XML) versus programmatically created UI’s in Android?

There are things that Google has done to speed up the declarative approach, but you still do have the layout inflation step done at runtime.

Have you ever switched (or considered) changing your UI from declarative to programmatic for any reason?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:00:05+00:00Added an answer on May 14, 2026 at 4:00 am

    Very little of the layout inflation is done at runtime. As hinted in the LayoutInflator API docs:

    For performance reasons, view
    inflation relies heavily on
    pre-processing of XML files that is
    done at build time. Therefore, it is
    not currently possible to use
    LayoutInflater with an XmlPullParser
    over a plain XML file at runtime

    If you take a look at the source, many of the views are pulled from a hash map based on their XML tag.

    In answer to your question of whether I have benchmarked the inflater, I have to say no. Personally I find the idea of benchmarking the layout inflater in Android for your app to be the equivalent of benchmarking the DOM parser in Firefox for your website. I don’t think the exercise is pointless, but you should have a much better reason than “my activity layout is too complicated for the inflater”…

    If you require a dynamically generated layout, you would be best off creating it programmatically. If your view is simply taking a long time to inflate, you should simplify your view XML.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone seen this error when working with a PHP application out of dynamic
Has anyone seen JavaMail not sending proper MimeMessages to an SMTP server, depending on
Has anyone seen rendering glitches with Papervision? Please seee the flash movie at http://www.mapopolis.com/test/
Has anyone seen an open-source library that produces charts similar to Github.com's commit timeline
Has anyone seen this: ?? No jgem command works at all?? Though jruby -S
Has anyone seen any image deskew algorithms in c#? I have found: http://www.codeproject.com/KB/graphics/Deskew_an_Image.aspx but
Has anyone ever seen this? I don't how to expand on this. It's the
Has anyone ever used the hidden class PackageParser in Android source code with java
Has anyone seen a solution for adding text fields to a UIAlertView (without private
Does anyone here has working nbgit plugin with Netbeans 6.9? I've seen some patches

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.