Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dFiyv-00005p-JA for pgadmin-hackers@arkaria.postgresql.org; Tue, 30 May 2017 15:22:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dFiyv-0000lL-67 for pgadmin-hackers@arkaria.postgresql.org; Tue, 30 May 2017 15:22:49 +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 1dFiyg-0000Ca-CG for pgadmin-hackers@postgresql.org; Tue, 30 May 2017 15:22:34 +0000 Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dFiyc-0002dQ-FT for pgadmin-hackers@postgresql.org; Tue, 30 May 2017 15:22:33 +0000 Received: by mail-io0-x230.google.com with SMTP id f102so58250689ioi.2 for ; Tue, 30 May 2017 08:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ChEykmCscE3mpfGx/JLMAR3CoLDHk98KnjfZ2QvcplU=; b=kajy9nvBws//3L1eHV9JQesl7hoATGfHbT7F/FpOcj/hO9l4XPUQOQ8zcjJ8sO8HET 9x21+o/lDWAJZWzetnNjNHnN4vJVvOjtylwNj3CmOVFyfOiMj6reEapTIeuA+FSqly7x OfcvpkqV0LZbu4IY8zhHtprNVfIn5eKzhA5LZQ3cmmYejUUcAbfnunb6hSZb4LLQQzZy RozKEvbMQ89CCxxyQNSRZBcoK6l00kPK5aHDTHS64OFuGtAQHaZu7GqnCR1JeyLHNpBA IDQ4Xzb1FwyA7U+q7jS+KuzerK/8D88IKgxa61AKuenQEAp6wuxzGSAxHVA5e3Zv9+OM bF9Q== 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=ChEykmCscE3mpfGx/JLMAR3CoLDHk98KnjfZ2QvcplU=; b=lLkET9A7DpQP1C+Z+BBKIrS73e6+S49Qwhdne2kqd8sCv3uH1/6FVhaZ7Cy/TbzGbE xRWnJoDyQ+FsHl4wErtp4x9X5KQf7x/PNcDn+OOZAUwphPHBobgDEomIf/ThRPD9n8nF oILUrCbVr9zq+zLifMxhayTrW41nYBUsyn4ifNFAuNfoqkRpUhwOYVpcz6xl51yKeU4u J12LvppIripVl4wSCEarSSEshvkqs8nMYdrw218DaVzkOWJPKWGfrQvJmfefE+ay1ul0 yVJRdWIgnAzcEVwi5nkanAeT1Iqp9qICKJWAyIyPhI3xNSo4BvBYf7vMt2b6slnnG3xw XuHg== X-Gm-Message-State: AODbwcB+bxNPTVmCkLaUqSrqSW1vefpKud2UNW4tz4Sk3r3Am/p6+V2u rwOy0xDrpVM7TFmK5cFjAU6BYIZxjrv0 X-Received: by 10.107.51.14 with SMTP id z14mr17713886ioz.84.1496157748714; Tue, 30 May 2017 08:22:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Tue, 30 May 2017 08:22:28 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Tue, 30 May 2017 16:22:28 +0100 Message-ID: Subject: Re: pgAdmin 4 commit: Cleanup handling of default/null values when data edi To: Surinder Kumar Cc: Harshal Dhumal , pgadmin-hackers Content-Type: text/plain; charset="UTF-8" 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 Thanks, applied. On Mon, May 29, 2017 at 7:08 AM, Surinder Kumar wrote: > Hi Dave, > > The grid was being re-rendered after add new row and copy/paste to add a > blank row in the end of grid, but in case of copy/paste batch operation it > should run once, so that code is moved out of addNewRow(...) and put into a > function grid.addBlankRow() and called separately for copy/paste after batch > operation is completed. > > Now copy/paste with 10k records took 2 seconds. > > Please find attached patch. > > > On Mon, May 29, 2017 at 5:19 AM, Dave Page wrote: >> >> On Sun, May 28, 2017 at 1:25 PM, Harshal Dhumal >> wrote: >> > 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) >> >> Copying that number of rows is an extreme case of course, but still... >> Is there an alternative way to batch notify? >> >> -- >> Dave Page >> Blog: http://pgsnake.blogspot.com >> Twitter: @pgsnake >> >> EnterpriseDB UK: http://www.enterprisedb.com >> The Enterprise PostgreSQL Company > > -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers