Subject: [RM#4307][pgAdmin4] Graphical Explain Plan - Embed images in explain plan only when user try to download it

From: Murtuza Zabuawala <[email-masked]>
Date: Thu, 30 May 2019 14:41:15 +0530

Hi,

Embedding images using *.toDataURL()* method hits the performance of the
explain plan rendering if the plan is complex because first it downloads
the images then it will convert each images into base64, to improve the
performance we will embed the images only when downloading of SVG is called
and not when displaying the graphical plan.

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

---

From: Aditya Toshniwal <[email-masked]>
Date: Thu, 30 May 2019 16:05:46 +0530

Hi Murtuza,

I was just going through code change, and I would suggest one small change.
In the image_mapper.js, export it as default, as it will have only one
export. Then you can use it as imageMapper.default rather than imageMapper.
imageMapper.
Otherwise, looks fine to me. I didn't test though :P

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

---

From: Murtuza Zabuawala <[email-masked]>
Date: Thu, 30 May 2019 17:01:32 +0530

Here is updated patch.

On Thu, May 30, 2019 at 4:06 PM Aditya Toshniwal <
[email-masked]> wrote:

> export. Then you can use it as imageMapper.default rather than
> imageMapper.imageMapper.

---

From: Akshay Joshi <[email-masked]>
Date: Thu, 30 May 2019 17:57:51 +0530

Thanks patch applied.

On Thu, May 30, 2019 at 5:01 PM Murtuza Zabuawala <
[email-masked]> wrote:

>>> Embedding images using *.toDataURL()* method hits the performance of
>>> the explain plan rendering if the plan is complex because first it
>>> downloads the images then it will convert each images into base64, to
>>> improve the performance we will embed the images only when downloading of
>>> SVG is called and not when displaying the graphical plan.
>>>
>>> --
>>> Regards,
>>> Murtuza Zabuawala

-- 
*Thanks & Regards*
*Akshay Joshi*

*Sr. Software Architect*
*EnterpriseDB Software India Private Limited*
*Mobile: +91 976-788-8246*