Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dF1xK-0000pz-Mi for pgadmin-hackers@arkaria.postgresql.org; Sun, 28 May 2017 17:26:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dF1xK-00078x-9I for pgadmin-hackers@arkaria.postgresql.org; Sun, 28 May 2017 17:26:18 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1dF1x4-0006JA-RW for pgadmin-hackers@postgresql.org; Sun, 28 May 2017 17:26:02 +0000 Received: from mail-it0-x235.google.com ([2607:f8b0:4001:c0b::235]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dF1x0-00011X-P0 for pgadmin-hackers@postgresql.org; Sun, 28 May 2017 17:26:02 +0000 Received: by mail-it0-x235.google.com with SMTP id r63so17438639itc.1 for ; Sun, 28 May 2017 10:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=e8CnmYez6LWko/JCmizvXFJA5xeiVN60ufGmLSTR+rI=; b=gy3Ohedrqp8v2Sc3kSVauc1ZmPOI1x6oFU96vOQQwbwZ7QGkjpRv1L9Qir7BV7QqB4 PTTRjmvtlQD4Rp8o9mpecTsNtFulcKLu4mT7x/4d4+ngUZz6Kb59P2UDy0u1PutUXwUp ttUd8ZfNluXPMjrIQHQ2y8Nj3csg8IM4k6ThZ9/CeaGmYJRtIj6ceouo4KZl07R5aOss K7tY+TK/MC/zW9LmiBZrLEfB4UWHpjqBSlUqgTeMeL4pMJ2RAbZK7PWabnGdg9MrFrLo t20FLGiDs2kyGUDJ/JCYuwkr147gwTLnFPNoODfXKm+kKhfI0R9VEr1ZVDwpbLDPW2Vh MKYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=e8CnmYez6LWko/JCmizvXFJA5xeiVN60ufGmLSTR+rI=; b=S0x8Qxa3KL74Howuv9LQ/8bI2MzGXJurmC0wnMZlKs0SWxFHEC/LNHW2ZF2UNxg/fp HpRwEWH1rYeoD3ZTOv++fcs+N8fbnizML2qb4XciJ2C2kqj7PDKy8DRpr/pCCUbGuXme 0OwAkuEKHO1isn/j5PPxoAtYmOMTAMqboN4GITj9pj9s53XFSy16IdjELNtEWrXUKky+ 6XWpGabpnLS8nNyG9UN7cwpSwVN5XVPbyKf3sl2euP0lfOUgJBwqCgudZSFuNx31bASk 64jnNSdayemD2Qmuk67bS0nUUpZ6Tr+3aRXyMqsiy0Pv2fvp7YAmv1qViX+nYuxjGKgC 5KiQ== X-Gm-Message-State: AODbwcBUVJ7xda3sXQ08QBM5Z8xmhNtQRFs8Ib+25WqaFnEzhEM2qzaL K8/IriOMFCjsbqaDn/qkiAqA0MjHpxBx X-Received: by 10.36.237.201 with SMTP id r192mr26219068ith.84.1495992356777; Sun, 28 May 2017 10:25:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.79.38.15 with HTTP; Sun, 28 May 2017 10:25:56 -0700 (PDT) In-Reply-To: References: From: Harshal Dhumal Date: Sun, 28 May 2017 22:55:56 +0530 Message-ID: Subject: Re: pgAdmin 4 commit: Cleanup handling of default/null values when data edi To: Surinder Kumar , Dave Page Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="f403045c08b603aae6055098ddad" X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgadmin-hackers Precedence: bulk Sender: pgadmin-hackers-owner@postgresql.org --f403045c08b603aae6055098ddad Content-Type: text/plain; charset="UTF-8" Hi, This commit has some performance issues with row paste functionality. For 2K copied rows with 3 columns (2 integer and one null column) it took near about 10 seconds to complete paste operation. And entire application becomes unresponsive for those 10 seconds. This is mainly because for each single pasted row entire grid is re-rendered ( is what I see in code). Ideally grid should be re-rendered only once after all rows are provided to grid. below code snippet from _paste_rows function _.each(copied_rows, function(row) { var new_row = arr_to_object(row); new_row.is_row_copied = true; row = new_row; self.temp_new_rows.push(count); grid.onAddNewRow.notify( {item: new_row, column: self.columns[0] , grid:grid} ) grid.setSelectedRows([]); count++; }); The statement grid.onAddNewRow.notify( {item: new_row, column: self.columns[0] , grid:grid} ) causes grid to re-render (as we listener on onAddNewRow event where we re-render the grid) -- *Harshal Dhumal* *Sr. Software Engineer* EnterpriseDB India: http://www.enterprisedb.com The Enterprise PostgreSQL Company On Sun, May 28, 2017 at 12:21 AM, Dave Page wrote: > Cleanup handling of default/null values when data editting. FIxes #2400 > > Branch > ------ > master > > Details > ------- > https://git.postgresql.org/gitweb?p=pgadmin4.git;a=commitdiff;h= > 1f26953504a963d2c2223c51f9da29db4d48594b > Author: Surinder Kumar > > Modified Files > -------------- > .../static/js/slickgrid/slick.pgadmin.editors.js | 58 ++++- > web/pgadmin/tools/sqleditor/command.py | 5 + > .../sqleditor/templates/sqleditor/js/sqleditor.js | 254 > ++++++++++++--------- > 3 files changed, 205 insertions(+), 112 deletions(-) > > > -- > Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgadmin-hackers > --f403045c08b603aae6055098ddad Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

This commit has some perfo= rmance issues with row paste functionality.
For 2K copied rows with 3 co= lumns (2 integer and one null column) it took near about 10 seconds to comp= lete paste operation. And entire application becomes unresponsive for those= 10 seconds.

This is mainly because for each single pasted row= entire grid is re-rendered ( is what I see in code).
Ideally grid shoul= d be re-rendered only once after all rows are provided to grid.

below code snippet from _paste_rows function

_.each(copied_rows, function(row) {
var new_row =3D arr_to_object(row);
new_row.is_row_copied= =3D true;
row =3D new_= row;
self.temp_new_rows.push(count);
grid.onAddNewRow.notify(=
{item: new_row, column: self.columns[0] , grid:grid}
)
grid.setSelectedRows([]);=
count++;
});
The statement
grid.onAddNewRow.notify(
{item: new_row, colu= mn: self.columns[0] , grid:gr= id}
)
causes grid to re-render (as we listener on onAddNewRow e= vent where we re-render the grid)







=












=C2=A0


=

<= div class=3D"gmail_signature" data-smartmail=3D"gmail_signature">
=
--= =C2=A0
Harshal Dhumal
Sr. Software Engineer

EnterpriseDB India:=C2=A0http://www.enterprisedb.com
The = Enterprise PostgreSQL Company

On Sun, May 28, 2017 at 12:21 AM, Dave Page = <dpage@pgadmin.org> wrote:
Cleanup handling of default/null values when data editting. FIxes #2400
Branch
------
master

Details
-------
https://git.postgresql.org/gitweb?p=3Dpgadmin4.git;a=3Dcommitdiff;h=3D1f26953504a963d2c2223c51f9da29db4d48594b
Author: Surinder Kumar <surinder.kumar@enterprisedb.com>

Modified Files
--------------
.../static/js/slickgrid/slick.pgadmin.editors.js=C2=A0 =C2=A0|=C2=A0 5= 8 ++++-
web/pgadmin/tools/sqleditor/command.py=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0|=C2=A0 =C2=A05 +
.../sqleditor/templates/sqleditor/js/sqleditor.js=C2=A0 | 254 ++++++++= ++++---------
3 files changed, 205 insertions(+), 112 deletions(-)


--
Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-ha= ckers

--f403045c08b603aae6055098ddad--