Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFtIt-0004l7-CU for pgadmin-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 06:09:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kFtIs-0001x3-5e for pgadmin-hackers@arkaria.postgresql.org; Wed, 09 Sep 2020 06:09:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kFtIr-0001wv-VJ for pgadmin-hackers@lists.postgresql.org; Wed, 09 Sep 2020 06:09:58 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kFtIo-0001t2-1w for pgadmin-hackers@postgresql.org; Wed, 09 Sep 2020 06:09:57 +0000 Received: by mail-ej1-x641.google.com with SMTP id lo4so1781547ejb.8 for ; Tue, 08 Sep 2020 23:09:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EgL6iuAlUi9ma0ruk6iWlqzi3bEXTMgRvvu7mp++VTA=; b=egmBPAzsvEn7sCvMPVXLruamNvlhpUH9OFc3S7CKbK5C0Q7/YR55RCX6S8BUxLdFZ+ +1xbHXdKy+B7TzoBUSfssMc7yahK1ME/RIxsVczB19zupZ9xe5PgmZIS5Dxrp/2QZOb1 IWzYBoldhi8PIuzFnEEFkH3SDtG/XqfsMwrPS1+BIw/bjh9QzMRJ0LFYQfZz8/jXXoDK cYGVxuWOB4O/v7oF1oWKT9GLd+z/2YOHwHRxMPrckhwhxXg/NT/jepkF4gKR8z36VNY3 lZ4UgQpUS547Nt4rPUj35hPuFrbPopKI3s9n0a5H1difJzIByDyZ/EgozXkvicg6XQ+N zoUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EgL6iuAlUi9ma0ruk6iWlqzi3bEXTMgRvvu7mp++VTA=; b=VKMwPS4MBACbVePMqZy0T3DM8g/IvbjArmMDvQ7gTm+LXT4zaFJtKvo8uYhY9YbkU9 YListpBHOMnxgv6ht14ZoL13DovwdKCxFbU5T17sG6yOn5Oj+gWtxGWbvYrqfXZgtXNa BjP1mmeoZUZla/zrGhy9de6p/8rEX1AbuOo+i3H/DR2h/m8hdDM8v9Z2pQE7txNMx9E7 y1MgnyNKxbxs5SXtuFa4MWK+uoXq3HLKV4xNHEBf3Nwl1gcH2C+rLHdOl/fB+1odJ+SO kQrFFLdWtLNk2wn7tLtMYNkMTueDoz6ndruDjdBiv15fxnL7pA67qJY+lCAfeUngRJHN Zg3g== X-Gm-Message-State: AOAM532/vJAOg7i67G9mLPXJnPb9CcBN0mdiOm4N/xJuv2iDo6Y02r96 bk2OQ8yzfXIlwACBtz0MKWwSkbOoYf4lR+M6I9EMVRdDOP6VSQnRD7WvTSq7gFlezpLrF4C5/iM sQ1CYT8tmDL7zwVQL+jMxzDX/GOufpVIHx3dh3SMaJLjOpCk0ZYQjGYKBx7QE5XP4msvuc8wtkq crzq8mTkUAOYj6YCm/wypiJuaLv1LHm3XqfMARUGvE4suruWJgdiz5b4r2KQ== X-Google-Smtp-Source: ABdhPJyl6rD2mpOvxR+Wioh/TZA9dafJbFmu+r/m+h1n0WWizGJA+aTwFtOSCe7X357itiXKymr7AhBNynVIjLAyx+0= X-Received: by 2002:a17:906:4a53:: with SMTP id a19mr2252210ejv.56.1599631792816; Tue, 08 Sep 2020 23:09:52 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Aditya Toshniwal Date: Wed, 9 Sep 2020 11:39:15 +0530 Message-ID: Subject: Re: [pgAdmin][RM5794] Excessive CPU usage while browser is idle To: Akshay Joshi Cc: pgadmin-hackers Content-Type: multipart/mixed; boundary="000000000000c86f6d05aedb4c40" X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c86f6d05aedb4c40 Content-Type: multipart/alternative; boundary="000000000000c86f6c05aedb4c3e" --000000000000c86f6c05aedb4c3e Content-Type: text/plain; charset="UTF-8" Hi, In the previous patch, I had changed the react state directly, which is not recommended and can cause unpredictable behavior. Attached patch changes the previous commit to avoid changing state directly. Please review. On Mon, Sep 7, 2020 at 6:48 PM Akshay Joshi wrote: > Thanks, patch applied. > > On Mon, Sep 7, 2020 at 3:59 PM Aditya Toshniwal < > aditya.toshniwal@enterprisedb.com> wrote: > >> Hi Hackers, >> >> Attached is the patch to stop the indefinite growth of graph dataset. >> This has caused excessive CPU usage and the patch will reduce it. >> >> Please review. >> >> -- >> Thanks, >> Aditya Toshniwal >> pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* >> >> "Don't Complain about Heat, Plant a TREE" >> > > > -- > *Thanks & Regards* > *Akshay Joshi* > *pgAdmin Hacker | Sr. Software Architect* > *EDB Postgres * > > *Mobile: +91 976-788-8246* > -- Thanks, Aditya Toshniwal pgAdmin hacker | Sr. Software Engineer | *edbpostgres.com* "Don't Complain about Heat, Plant a TREE" --000000000000c86f6c05aedb4c3e Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

In the previous patch, I had changed the react state d= irectly, which is not recommended and can cause unpredictable behavior.=C2= =A0
Attached patch changes the previous commit to avoid changing state dire= ctly.

Please review.

On Mon, Sep 7, 2020 at 6:48 PM Akshay Joshi = <akshay.joshi@enterpris= edb.com> wrote:
Thanks, patch applied.

On Mon, Sep 7, 2020 at 3:59 P= M Aditya Toshniwal <aditya.toshniwal@enterprisedb.com> wrote:
Hi Hackers,=

Attached is the patch to stop the indefinite growth of graph dataset.= This has caused excessive CPU usage and the patch will reduce it.

Ple= ase review.

--
Thanks,<= font face=3D"arial, sans-serif">Aditya Toshniwal
=
pgAdm= in hacker=C2=A0| Sr. Software Engineer | edbpostgres.com
"Don't Complain = about Heat, Plant a TREE"
<= /div>


--
Thanks & R= egards
Akshay Joshi
pgAdmin Hacker | Sr. Software Architect=
= EDB Postgres
Mobile: +91 976-788-8246



--
Thanks,
Aditya Toshniwal
pgAdmin hacker=C2=A0| Sr. Softwa= re Engineer | edbpostgres.com<= /font>
"Don't Complain about Heat, Plant a TREE&qu= ot;
--000000000000c86f6c05aedb4c3e-- --000000000000c86f6d05aedb4c40 Content-Type: application/octet-stream; name="RM5794.part2.patch" Content-Disposition: attachment; filename="RM5794.part2.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-Id: f_keuzfshk0 ZGlmZiAtLWdpdCBhL3dlYi9wZ2FkbWluL2Rhc2hib2FyZC9zdGF0aWMvanMvR3JhcGhzLmpzeCBi L3dlYi9wZ2FkbWluL2Rhc2hib2FyZC9zdGF0aWMvanMvR3JhcGhzLmpzeAppbmRleCBlODg2MmEx MDkuLmFkMmIzY2Y5MiAxMDA2NDQKLS0tIGEvd2ViL3BnYWRtaW4vZGFzaGJvYXJkL3N0YXRpYy9q cy9HcmFwaHMuanN4CisrKyBiL3dlYi9wZ2FkbWluL2Rhc2hib2FyZC9zdGF0aWMvanMvR3JhcGhz LmpzeApAQCAtODAsMTUgKzgwLDIwIEBAIGV4cG9ydCBmdW5jdGlvbiBzdGF0c1JlZHVjZXIoc3Rh dGUsIGFjdGlvbikgewogICAgIGFjdGlvbi5jb3VudGVyRGF0YSA9IGFjdGlvbi5pbmNvbWluZzsK ICAgfQogCisgIG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