Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dF7wG-0005xa-OZ for pgadmin-hackers@arkaria.postgresql.org; Sun, 28 May 2017 23:49:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1dF7wF-0001Yw-FZ for pgadmin-hackers@arkaria.postgresql.org; Sun, 28 May 2017 23:49:35 +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 1dF7wD-0001Yd-Sh for pgadmin-hackers@postgresql.org; Sun, 28 May 2017 23:49:34 +0000 Received: from mail-it0-x231.google.com ([2607:f8b0:4001:c0b::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1dF7w9-0008F6-Eq for pgadmin-hackers@postgresql.org; Sun, 28 May 2017 23:49:33 +0000 Received: by mail-it0-x231.google.com with SMTP id g126so19438621ith.0 for ; Sun, 28 May 2017 16:49:28 -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=YkgbnEc6ZBhRCBOxnEZ1NXDtMHnL2hpNT/Ox/giCO2g=; b=hSg6xDklehMkVGiHmWVHl+gAXaf9YSPS9zined9z9RBIyiWRFPQ23+I/UUqqwwSfzn 7O8vc+bVMbYEEAzhEg81xGCk69DLI5MCxU8J/DyuPzwKpOKGl+/jX1jXEpvCNR9i5AGO Q33prXSfdiF/QUnRNet1ZzLJMOGMboXf9c92M02g/xhiLJsv92uA2gcjuCY+bKk4sW2d hrFLwImG9EEyrXlYBUOvt9aPgEgfMOrtHWHVTA33/sC0YFs8Qhxmc0PyjXYnK+97KWvb DNFvfxJrgGrmVcMgb9A3ZPw9gLcPHBQ4ijAmGWMKitVzdlIt21XQM7QpTcuR0qOGzTjA srdg== 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=YkgbnEc6ZBhRCBOxnEZ1NXDtMHnL2hpNT/Ox/giCO2g=; b=rLREpLihaf6LPyPtoFb9lfMNAq+6fdEZBYm4qxUQEz7a25uZ0jmev2vd1dcjtM4ys4 NJQORtOwefjpNBSRlMqVw/WbSnQFiVzPNwikTBDtQ3upZ1rSsi7W9cajxD5fbyGXWK/v AElvT8FegORRqCsmxNSE0c8Y8xzS8UBPOsPsLkPWKuzZ6pgfFwtq1j0GNugdB9MyzbFz JJVwskGCYSWRZZ8+XtVrkc5X/ukSmFf3ewmBPgBOZV7vnzE1WoQ/raheqjvObqRBPCzH 35vRIhpqAqv4WxinwgL/zbiPP29zMyuMsj1F2lFjb+LdoJ9bjwJkA9iVbz4EAuLkPguO r8VQ== X-Gm-Message-State: AODbwcDkIbkOZyJYvTjQ56FNpZM7dPeuLuR3nRwG1c29czBSAyn8r6P4 GwYacGCNrrbSAKi3xysSntXe9xMTeERH X-Received: by 10.36.17.197 with SMTP id 188mr29293902itf.28.1496015366479; Sun, 28 May 2017 16:49:26 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.174.147 with HTTP; Sun, 28 May 2017 16:49:25 -0700 (PDT) In-Reply-To: References: From: Dave Page Date: Sun, 28 May 2017 19:49:25 -0400 Message-ID: Subject: Re: pgAdmin 4 commit: Cleanup handling of default/null values when data edi To: Harshal Dhumal Cc: Surinder Kumar , 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 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 -- Sent via pgadmin-hackers mailing list (pgadmin-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgadmin-hackers