Re: [pgAdmin][RM4701] Webpack optimization

From: Aditya Toshniwal <aditya(dot)toshniwal(at)enterprisedb(dot)com>
To: Dave Page <dpage(at)pgadmin(dot)org>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>, Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Subject: Re: [pgAdmin][RM4701] Webpack optimization
Date: 2019-09-18 11:53:13
Message-ID: CAM9w-_mQJVutdA9AsANBBm4BwxWhbtgSjfyMNLW6MZNBYSGBSg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

On Wed, Sep 18, 2019 at 4:26 PM Dave Page <dpage(at)pgadmin(dot)org> wrote:

> Nice!
>
> What do we need to make Lighthouse entirely happy? :-)
>
We cannot. :P
It is based on many parameters like the time taken to show the first text,
JS dependency required to load, etc. These are mostly related to initial
page load. We cache the files and bust it only on release. Loading the
files is kind of one time fetch. I think we can't (should not spend time) do
much about it.

On a more serious note, should we disable compression in desktop mode?
> Seems like that would probably just use CPU cycles unnecessarily.
>
Yes. That can be done, nice.

>
> On Wed, Sep 18, 2019 at 9:57 AM Aditya Toshniwal <
> aditya(dot)toshniwal(at)enterprisedb(dot)com> wrote:
>
>> Hi Hackers,
>>
>> Attached is the patch to optimise webpack bundled files for improving
>> performance.
>> @Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com> Thank you for your
>> suggestions and inputs.
>>
>> Changes include:
>> 1) Remove underscore-string and sprintf-js packages as we were using only
>> %s. Instead, added a function to do the same. Also changed gettext to
>> behave like sprintf directly.
>> 2) backgrid.sizeable.columns was not used anywhere, removed.
>> @babel/polyfill is deprecated, replaced it with core-js.
>> 3) Moved few css to make sure they get minified and bundled.
>> 4) Added Flask-Compress to send static files as compressed gzip. This
>> will reduce network traffic and improve initial load time for pgAdmin.
>> 5) Split few JS files to make code reusable.
>> 6) Lazy load few modules like leaflet, wkx is required only if geometry
>> viewer is opened. snapsvg loaded only when explain plan is executed. This
>> will improve sqleditor initial opening time.
>>
>> Below is the size and files difference after and before the changes:
>> [image: Screenshot 2019-09-18 at 14.13.02.png][image: Screenshot
>> 2019-09-18 at 14.04.41.png]
>> Below is the lighthouse (Chrome extension) report after and before the
>> changes:
>> [image: Screenshot 2019-09-18 at 13.53.10.png] [image: Screenshot
>> 2019-09-18 at 14.08.20.png]
>>
>> Do not forget to do a yarn install and a pip install
>> Kindly review.
>>
>> --
>> Thanks and Regards,
>> Aditya Toshniwal
>> Software Engineer | EnterpriseDB India | Pune
>> "Don't Complain about Heat, Plant a TREE"
>>
>
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>

--
Thanks and Regards,
Aditya Toshniwal
Software Engineer | EnterpriseDB India | Pune
"Don't Complain about Heat, Plant a TREE"

In response to

Browse pgadmin-hackers by date

  From Date Subject
Next Message Aditya Toshniwal 2019-09-18 11:54:52 Re: [pgAdmin][RM4701] Webpack optimization
Previous Message Ashesh Vashi 2019-09-18 11:35:06 Re: [pgAdmin][RM4701] Webpack optimization