Thursday, January 2, 2014

Profiling GWT applications with v8 and d8

The v8 JavaScript engine has a command line version called d8 that can be used as a profiler.
It can help you spot performance problems with your JavaScript in many different ways. If you want to get a good overview of how to profile JavaScript, here is a Google I/O talk on the subject: "Breaking the JavaScript speed limit with v8".
Unfortunately the d8 profiler was not very useful for GWT applications (or any application that was compiled to JavaScript) in the past, since it highlighted problems in JavaScript with line numbers, which does not make a whole lot of sense for a GWT application. Compiling in pretty mode was no option either, since different code layout will lead to different optimizations in v8 (Currently v8 backs our of optimizing a function if it is too large, also counting comments). And of course you want to profile the same code that will be run by your users.

This is why we added source maps support to the v8 profiling tools. Using a special GWT linker you can now profile your GWT application in d8 and get back Java line numbers. This is one of the things that we did to help the our colleagues to make Google Sheets as fast as possible.

Here is how you can profile your GWT application:

Build v8 locally

Build your version of v8 using these instructions. After that make sure that d8 (most likely under out/native) and the tickprocessor (tools/mac-tick-processor or tools/linux-tick-processor or tools/windows-tick-processor.bat)  are available in your path.

Create an entrypoint that runs your performance critical code

Create a new GWT module with an EntryPoint that calls your performance critical code. In your gwt.xml file you need to add the linker, set the user agent and enable source maps:

<define-linker name="d8" class="com.google.gwt.core.linker.D8ScriptLinker"/>
<add-linker name="d8" />
<set-property name="user.agent" value="safari" />
<set-property name="compiler.useSourceMaps" value="true"/>

Compile your GWT app

Now you can just invoke the GWT compiler for your module. It will produce three files that you should move into one directory for your profile:
  • selection script: .nocache.js
  • actual program: .js
  • sourcemap: (located in WEB-INF/deploy//symbolmaps/_sourceMap0.json)

Run the profiler

This blog post does not cover all the details on how to use d8, this is much better covered by the v8 team, but most of the times for a GWT app you want to run:

d8 -prof <modulename>.js

(You want to make sure that all files are in the same directory and that you are running d8 from that directory)
This will create a file called v8.log that contains all the information from that profile run. Now we will use the tick processor to analyze this file, but we also need to pass it the source map, so that it can give us Java line numbers:

linux-tick-processor --sourceMap=<path to sourcemap> v8.log

This will output a complete profile of your JavaScript. It will show you how much time you spend executing JavaScript (and which functions / Java methods), executing C++ or in library code. It also contains a drill down view of your profile.

Sum up

With the changes we made to v8 and GWT you can now use the great v8 toolchain to spot performance problems in your GWT applications. These tools will also allow us to improve the way the GWT compiler translates code in order to make it run faster as well as improving the standard libraries that come with GWT.  You can look forward to your GWT applications running faster in the future.

97 comments:

  1. This comment has been removed by the author.

    ReplyDelete
    Replies
    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

      Delete
  2. I like d8 application because it is useful for profiler. Currently i am working on event planning app for ipad and d8 is very helpful in my working activities.

    ReplyDelete
  3. The primary objective of implementing SEO to a company's website is to drive targeted traffic to it. Eye tracking studies have shown that searchers scan a search result from top to bottom and left to right, looking for relevant results.Blog Comment

    ReplyDelete
  4. Profile Picture is the new term introduced by Facebook Romantic Whatsapp DP download of the year. Whatsapp DP Images download: We have collected the most recent DP and profile pic

    ReplyDelete
  5. I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. Thank you a lot! and if you need App development company then contact us!

    ReplyDelete
  6. I'm glad that there are people who still care more about cultural development and education.

    tutu app
    tutuapp
    tutuapp download

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. SEO is so important. In short, SEO is significant because it makes your website more visible, and that means more traffic and more opportunities to convert prospects into customers. I work for a software house Karachi and will definitely share this post to my colleagues.

    ReplyDelete
  9. Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article. web design company

    ReplyDelete
  10. ketika pria sudah tidak bisa lagi memberi kepuasan maka yang dikhawatirkan wanita akan merasakan kebosanan jika kejadian seperti itu tidak segera diatasi, oleh karena itu levitra asli 100 mg cod bandung bisa menjadi solusi pasutri yang ingin mencapai kepuasan dalam bercinta. viagra asli adalah tablet mungil yang berasal dari bayer sangat bermanfaat bagi pria yang ingin memperbaiki ereksi agar bisa mencapai klimaks. wanita butuh hubungan yang lama agar libidonya bisa terangsang sampai puncak klimaks. procomil spray sangat cocok untuk mengatasi ejakulasi dini pria ketika sedang berhubungan badan. vitamale adalah obat kuat bpom yang dibuat diindonesia berguna untuk memelihara stamina pria agar tetap kuat saat diranjang klik web . banyak pria yang mencari vimax spray untuk memuaskan pasangan mereka supaya tidak cepat keluar sperma waktu sedang berhubungan.

    ReplyDelete
  11. Write more, that’s all I have to say.
    Literally, it seems as though you relied on the video to make your point.
    Thanks for sharinhg!
    Keep it up!
    blue-iris-5-3-crack/

    ReplyDelete
  12. The company that provides the best bathroom remodeling near me is Fairbanks Builders.

    ReplyDelete
  13. I recently found many useful information in your website especially this blog page. Among the lots of comments on your articles. Thanks for sharing.
    how much does metal roofing cost

    ReplyDelete
  14. It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.
    wedding videography prices

    ReplyDelete
  15. Thanks you very much for sharing these links. Will definitely check this out..
    content creation

    ReplyDelete
  16. This comment has been removed by the author.

    ReplyDelete
  17. You have a good point here!I totally agree with what you have said!!Thanks for sharing your views...hope more people will read this article!!!
    md landscaping

    ReplyDelete
  18. I recently came across your blog and have been reading along. I thought I would leave my first comment. I don't know what to say except that I have enjoyed reading. Nice blog. I will keep visiting this blog very often.
    the kind of apartment you want

    ReplyDelete
  19. Practitioners are coming up with technology to reduce the side effects that is well revised by the manufacturers to produce a well-organized mandibular advancement device which fuels the growth of mandibular advancement devices market globally.

    Also read: acetic anhydride market | Medical Devices Market

    ReplyDelete
  20. Great post, and great website. Thanks for the information!
    moe's pizza near me

    ReplyDelete
  21. That appears to be excellent however i am still not too sure that I like it. At any rate will look far more into it and decide personally!
    professional article writing service

    ReplyDelete
  22. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.
    hair salon raleigh nc

    ReplyDelete
  23. Thank you so much for sharing this great blog.Very inspiring and helpful too.Hope you continue to share more of your ideas.I will definitely love to read.
    script writers for hire

    ReplyDelete
  24. Thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success..
    moss hawg

    ReplyDelete
  25. Your website is really cool and this is a great inspiring article. Thank you so much.
    email copywriting services

    ReplyDelete
  26. Thanks for the post and great tips..even I also think that hard work is the most important aspect of getting success..
    Davis County homes for sale

    ReplyDelete
  27. It was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks.
    coleman fast pitch tents

    ReplyDelete
  28. Read Ample Advice From Successful Multi-level Marketing Experts

    People need extra money today. Having more than one form of income helps balance the budget. There are so many people who are actually earning extra income with the help of multi-level marketing. You can reap the benefits of these companies if you have the right information. Continue reading for some crucial information about profiting in MLM.

    If you have a multi-level marketing business with a focus on product parties, make sure to book a minimum of three parties at every event. Before walking away from each event, try to schedule at least three more parties. Doing this will ensure that your business grows rather than just sustain itself.Tools for BI analysts

    Work hard each day. You need to climb higher and raise your goals. Your business should make some small progress every day. This doesn't necessarily have to be a huge advancement. Just a little bit of sharing on social networks could be enough.

    Teach yourself multiple methods of marketing. To succeed at multi-level marketing, you need to become a student of a lot of different marketing tactics and styles. It's important to know how to market as much face to face as it is behind a computer. You'll use all these skills.

    Listen to your customers and solve their problems with your products. That's the key to selling in a heart beat. It starts with knowing your product like the back of your hand and listening to your customers with a keen ear. You'll soon discover ways your product can really help them.

    Learn the realities of MLM. You may have seen some marketers may sell products claiming that you can earn a lot of income quickly. Be careful of scams like this. Like other endeavors, you may not earn anything in MLM. However, hard work, a solid marketing strategy, and great marketing skills can help you see success.

    In order to succeed in multi-level marketing, you must be willing to listen to your mentors and learn. Most multi-level marketing companies offer mentorship from the company's MLM veterans to new representatives. It is in the veteran's best interest to see you succeed, so most of the time they are willing to teach you how the system works. You can duplicate your mentor's success by listening and practicing what they teach.

    Now you are equipped with the knowledge you need to achieve success in MLM. Put these ideas into play, and let the money roll in. Eventually you may have an income stream that can really help you when you need to get your bills paid.

    ReplyDelete
  29. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    250 watt solar panel

    ReplyDelete
  30. Folder Guard Crack is software designed to protect and hide your personal files from other users and keep your important data safe from prying eyes.
    Antares Autotune Pro Crack Mac
    Neat Video Crack
    Advanced Systemcare Pro Crack Serial Key

    ReplyDelete
  31. Omnisphere Crack is arguably one of the most powerful and amazing software programs available on the market and can be downloaded completely free of charge in the iso documentation.
    Filmora Crack
    Hex Editor Neo 6 Crack Keygen
    Rhino 6 Crack

    ReplyDelete
  32. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work.
    cavalleria toscana australia

    ReplyDelete
  33. You know your projects stand out of the herd. There is something special about them. It seems to me all of them are really brilliant!
    mop definition

    ReplyDelete
  34. The information you have posted is very useful. The sites you have referred was good. Thanks for sharing...
    Delta 8 THC winston Salem

    ReplyDelete
  35. Love what you're doing here guys, keep it up!..
    salem dispensary

    ReplyDelete
  36. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you.
    https://voyance-tel-avenir.com/

    ReplyDelete
  37. I really thank you for the valuable info on this great subject and look forward to more great posts. Thanks a lot for enjoying this beauty article with me. I am appreciating it very much! Looking forward to another great article. Good luck to the author! All the best!
    kitchen remodeling companies

    ReplyDelete
  38. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    moe's doughs

    ReplyDelete
  39. Your website is really cool and this is a great inspiring article.
    casket

    ReplyDelete
  40. Hi, I find reading this article a joy. It is extremely helpful and interesting and very much looking forward to reading more of your work..
    bathroom remodeling contractors

    ReplyDelete
  41. Wow i can say that this is another great article as expected of this blog.Bookmarked this site..
    importance of team alignment

    ReplyDelete
  42. I can see that you are an expert at your field! I am launching a website soon, and your information will be very useful for me.. Thanks for all your help and wishing you all the success in your business.
    kitchen and bath remodeling

    ReplyDelete
  43. Nice to read your article! I am looking forward to sharing your adventures and experiences.
    Arenal Volcano Chocolate Tour

    ReplyDelete
  44. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    cbd cigarettes

    ReplyDelete
  45. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    Loose Herbs

    ReplyDelete
  46. I am definitely enjoying your website. You definitely have some great insight and great stories.
    The Whaley Center Fayetteville NC

    ReplyDelete
  47. I am a new user of this site so here i saw multiple articles and posts posted by this site,I curious more interest in some of them hope you will give more information on this topics in your next articles.  Samsung Galaxy Note20 5G Price in Uganda

    ReplyDelete
  48. Hey what a brilliant post I have come across and believe me I have been searching out for this similar kind of post for past a week and hardly came across this. Thank you very much and will look for more postings from you.
    Manuel Antonio Costa Rica ATV Tour

    ReplyDelete
  49. Great article Lot's of information to Read...Great Man Keep Posting and update to People..Thanks
    Manuel Antonio Costa Rica Quadbikes

    ReplyDelete
  50. I found that site very usefull and this survey is very cirious, I ' ve never seen a blog that demand a survey for this actions, very curious...
    slot joker123

    ReplyDelete
  51. This is a great post I seen because of offer it. It is truly what I needed to see seek in future you will proceed after sharing such a magnificent post. Oppo A12s Price in Nepal

    ReplyDelete
  52. This is my first time visit here. From the tons of comments on your articles,I guess I am not only one having all the enjoyment right here!
    Everyone Loves a Pinup Girl

    ReplyDelete
  53. It is imperative that we read blog post very carefully. I am already done it and find that this post is really amazing.
    Digital Marketer

    ReplyDelete
  54. Thanks you very much for sharing these links. Will definitely check this out..
    best digital marketing consultant in india

    ReplyDelete
  55. It was wondering if I could use this write-up on my other website, I will link it back to your website though.Great Thanks.
    Rencontre Marseille

    ReplyDelete
  56. Thanks for a wonderful share. Your article has proved your hard work and experience you have got in this field. Brilliant .i love it reading.
    Beauté Marseille

    ReplyDelete
  57. I think this is a really good article. You make this information interesting and engaging. You give readers a lot to think about and I appreciate that kind of writing.
    ebook writing packages

    ReplyDelete
  58. I found this is an informative and interesting post so i think so it is very useful and knowledgeable. I would like to thank you for the efforts you have made in writing this article.
    social media content creation services

    ReplyDelete
  59. Thanks for the blog post buddy! Keep them coming...
    home builders

    ReplyDelete
  60. Excellent and very exciting site. Love to watch. Keep Rocking.
    roofing contractors

    ReplyDelete
  61. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.
    Nashville home cleaning services

    ReplyDelete
  62. Thanks for taking the time to discuss this, I feel strongly that love and read more on this topic. If possible, such as gain knowledge, would you mind updating your blog with additional information? It is very useful for me.
    infographics writing service

    ReplyDelete
  63. I found your this post while searching for some related information on blog search...Its a good post..keep posting and update the information.
    pgslot

    ReplyDelete
  64. I read that Post and got it fine and informative. Please share more like that...
    https://hemphousenc.com/

    ReplyDelete
  65. Love to read it,Waiting For More new Update and I Already Read your Recent Post its Great Thanks.
    Autograph

    ReplyDelete
  66. Wonderful illustrated information. I thank you about that. No doubt it will be very useful for my future projects. Would like to see some other posts on the same subject!
    Autograph request

    ReplyDelete
  67. Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. If possible, as you gain expertise, would you mind updating your blog with more information? It is extremely helpful for me.
    The Detail Guys MD

    ReplyDelete
  68. I admire what you have done here. I like the part where you say you are doing this to give back but I would assume by all the comments that this is working for you as well.
    The Detail Guys MD

    ReplyDelete
  69. Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!THANKS!!!!!!
    luxury home builders

    ReplyDelete
  70. Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking.
    professional white paper writers

    ReplyDelete
  71. I'm glad I found this web site, I couldn't find any knowledge on this matter prior to.Also operate a site and if you are ever interested in doing some visitor writing for me if possible feel free to let me know, im always look for people to check out my web site.
    best blog writing companies

    ReplyDelete
  72. This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.
    ebook writing packages

    ReplyDelete
  73. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    west marine dog life jacket

    ReplyDelete
  74. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
    article writing services

    ReplyDelete
  75. hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back.
    newsletter writing services

    ReplyDelete
  76. What a fantabulous post this has been. Never seen this kind of useful post. I am grateful to you and expect more number of posts like these. Thank you very much.
    cbd oil winston salem

    ReplyDelete
  77. I’ve read some good stuff here. Definitely worth bookmarking for revisiting. I surprise how much effort you put to create such a great informative website.
    professional technical writing services

    ReplyDelete
  78. This is such a great resource that you are providing and you give it away for free. I love seeing websites that understand the value of providing a quality resource for free. It is the old what goes around comes around routine.
    professional video script writing

    ReplyDelete
  79. i am always looking for some free stuffs over the internet. there are also some companies which gives free samples.
    white paper writing packages

    ReplyDelete
  80. http://www.quinnrollins.com/2017/10/lego-announces-women-of-nasa.html?showComment=1637018640569#c1576929145689198626

    ReplyDelete
  81. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information...
    resume writers

    ReplyDelete
  82. Hey There. I found your blog using msn. This is a very well written article. I’ll be sure to bookmark it and come back to read more of your useful info. Thanks for the post. I’ll definitely return.
    why is prayer necessary

    ReplyDelete
  83. This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information...
    best press release writing services

    ReplyDelete
  84. This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article.
    sales and general email copywriters

    ReplyDelete
  85. Someone Sometimes with visits your blog regularly and recommended it in my experience to read as well. The way of writing is excellent and also the content is top-notch. Thanks for that insight you provide the readers!
    best cover letter writing services

    ReplyDelete
  86. Great post I would like to thank you for the efforts you have made in writing this interesting and knowledgeable article.
    seo specialists

    ReplyDelete
  87. Sheffield Taxi A1 Taxis Sheffield is a professional Taxi Company in Sheffield that offers a superior taxi service for customers in the region. Our Wheelchair Accessible Taxis ensure that everyone can easily enter our vehicles.

    ReplyDelete
  88. I’m Freelancer Santo (Mr. Santo), From Bangladesh-based Web Design, Web Development, Graphic Design, Digital Marketing, WooCommerce, Article Writing, SEO & Data Entry, Virtual Assistant, Many More. We Have 25 members In my Team all are experts and experience more them 5+ Years. The Best Freelancer Team in BD. You can let us know for whatever work we do together with efficiency and honesty. If you want you can see our work samples. We will share all our work experiences with you, then why are you late? Let’s get acquainted. Thank You! Mr. Santo Web Designer

    ReplyDelete
  89. Thanks For sharing this Superb article.I use this Article to show my assignment in college.it is useful For me Great Work.
    what is morganite stone

    ReplyDelete