<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: sathish bottula</title>
    <description>The latest articles on DEV Community by sathish bottula (@saty932).</description>
    <link>https://dev.to/saty932</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F503394%2F0765d9de-2c76-4581-b336-1336c75584da.jpeg</url>
      <title>DEV Community: sathish bottula</title>
      <link>https://dev.to/saty932</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/saty932"/>
    <language>en</language>
    <item>
      <title>How did I improve angular app performance drastically?</title>
      <dc:creator>sathish bottula</dc:creator>
      <pubDate>Sat, 16 Jan 2021 14:23:30 +0000</pubDate>
      <link>https://dev.to/saty932/how-did-i-improve-angular-app-performance-drastically-2f1e</link>
      <guid>https://dev.to/saty932/how-did-i-improve-angular-app-performance-drastically-2f1e</guid>
      <description>&lt;p&gt;Initially, I checked my app first meaningful paint time, it was showing 17secs and performance rating was 20 per cent. Finally, I was able to reduce to 5secs meaningful paint time and 70 performance rating using the below methods.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. Reusable Components
&lt;/h4&gt;

&lt;p&gt;First, figure out where there is a possibility to reuse components. It helps you to reduce app size.&lt;/p&gt;

&lt;h4&gt;
  
  
  2. Lazy Loading
&lt;/h4&gt;

&lt;p&gt;Lazy loading helps you to load certain modules only when needed rather than loading all things at a time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://angular.io/guide/lazy-loading-ngmodules"&gt;https://angular.io/guide/lazy-loading-ngmodules&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  3. Caching with Service Worker
&lt;/h4&gt;

&lt;p&gt;Angular pwa help you cache assets and apis too. I used service worker to cache assets and some apis which are not gonna change frequently. You have even an option to give expire time for cache.&lt;/p&gt;

&lt;h4&gt;
  
  
  4. Lazy load scripts
&lt;/h4&gt;

&lt;p&gt;You can load some external js scripts dynamically rather than loading all at the initial time.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://thecodeframework.com/angular-how-to-lazy-load-external-scripts/"&gt;https://thecodeframework.com/angular-how-to-lazy-load-external-scripts/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Try to use async and defer depends upon the scripts which you imported, it helps you to load scripts asynchronously with page parsing and after page parsing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://javascript.info/script-async-defer"&gt;https://javascript.info/script-async-defer&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  5. Import what you need
&lt;/h4&gt;

&lt;p&gt;When we import ui libraries, we import all components rather than importing what are we using.&lt;/p&gt;

&lt;p&gt;Let me explain in detail, rather than importing whole library css&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'antd/dist/antd.css'; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;you can import what all needed&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import 'antd/lib/notification/style/css';
import 'antd/lib/modal/style/css';
import 'antd/lib/spin/style/css';
import 'antd/lib/select/style/css';

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  6. Image Thumbnails
&lt;/h4&gt;

&lt;p&gt;In some cases, we don't have to show high-resolution pic. Even if we see flipkart and amazon products list there you don't have to show high-resolution pic. Figure out where all you can just show a thumbnail.&lt;/p&gt;

&lt;h4&gt;
  
  
  7. Lazy Load Images
&lt;/h4&gt;

&lt;p&gt;Rather than loading all images when page loads you can lazy load images means when user gonna interact ui then only we load the image. Suppose if you have multiple sections with images rather than loading all sections images at a time you can load images when user gonna interact.&lt;/p&gt;

&lt;h4&gt;
  
  
  8. Shared Modules
&lt;/h4&gt;

&lt;p&gt;Creating shared modules allows you to organize and streamline your code. You can put commonly used directives, pipes, and components into one module and then import just that module wherever you need it in other parts of your app&lt;/p&gt;

&lt;p&gt;&lt;a href="https://angular.io/guide/sharing-ngmodules"&gt;https://angular.io/guide/sharing-ngmodules&lt;/a&gt;&lt;/p&gt;

</description>
      <category>angular</category>
      <category>javascript</category>
      <category>react</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Tools which help you to improve web app performance</title>
      <dc:creator>sathish bottula</dc:creator>
      <pubDate>Sun, 10 Jan 2021 05:17:33 +0000</pubDate>
      <link>https://dev.to/saty932/tools-which-help-you-to-improve-web-app-performance-kpa</link>
      <guid>https://dev.to/saty932/tools-which-help-you-to-improve-web-app-performance-kpa</guid>
      <description>&lt;h1&gt;
  
  
  1.Light House (Google)
&lt;/h1&gt;

&lt;p&gt;Google Lighthouse is an open-source, automated tool for measuring the quality of web pages.I used google light house which really helps you to improve your app performance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/web/tools/lighthouse"&gt;https://developers.google.com/web/tools/lighthouse&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--XcCwlAfc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k22jmh7row40cxkumpqa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--XcCwlAfc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/k22jmh7row40cxkumpqa.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  2.GT Metrix
&lt;/h1&gt;

&lt;p&gt;GTmetrix is a free tool that analyzes your page's speed performance. It's also a similar tool you can place you are url and check the performance.(now GTmetrix is powered by lighthouse)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://gtmetrix.com/"&gt;https://gtmetrix.com/&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--8PpMJRdY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9mt05xnumz1x764q5yh4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--8PpMJRdY--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9mt05xnumz1x764q5yh4.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>react</category>
      <category>angular</category>
      <category>javascript</category>
      <category>vue</category>
    </item>
    <item>
      <title>How to use reduce with React?</title>
      <dc:creator>sathish bottula</dc:creator>
      <pubDate>Sun, 01 Nov 2020 00:33:54 +0000</pubDate>
      <link>https://dev.to/saty932/how-to-use-reduce-with-react-147c</link>
      <guid>https://dev.to/saty932/how-to-use-reduce-with-react-147c</guid>
      <description>&lt;h3&gt;
  
  
  What is the use of reduce in Javascript?
&lt;/h3&gt;

&lt;p&gt;The reduce() method executes a reducer function (that you provide) on each element of the array, resulting in single output value.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//prints 27&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In the above example, we are using reduce for sum of array.&lt;/p&gt;

&lt;h4&gt;
  
  
  What in case if you want to pass a value to accumulator?
&lt;/h4&gt;

&lt;p&gt;reduce accepts two params function, param.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;&lt;span class="c1"&gt;//prints 47&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  How to use reduce in react now?
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;React&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nx"&gt;App&lt;/span&gt; &lt;span class="kd"&gt;extends&lt;/span&gt; &lt;span class="nx"&gt;Component&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;render&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;6&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="mi"&gt;8&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nx"&gt;a&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reduce&lt;/span&gt;&lt;span class="p"&gt;(((&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="o"&gt;+&lt;/span&gt;&lt;span class="nx"&gt;currentValue&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
      &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
        Total sum is &lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;total&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;    
      &lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>react</category>
      <category>javascript</category>
      <category>reactnative</category>
    </item>
  </channel>
</rss>
