Skip to content

Commit

Permalink
BUG: fix performance issue where sidebar would freeze, time out, or f…
Browse files Browse the repository at this point in the history
…ail to display when processing a large number of invalid cells

Now sidebar only displays the first 250 invalid cells.

Fixes #62.
  • Loading branch information
jairideout committed Jan 28, 2016
1 parent 79f3933 commit 7ec03b3
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

**Note on versioning:** the version numbers used here match the version numbers displayed to users in the Chrome Web Store. Sometimes there are gaps between release versions (e.g., version 2 jumps to version 5). This happens because each separate upload of Keemei to the web store increments the version number, and sometimes multiple uploads are necessary before a release is finalized (e.g., if the release is reviewed by an add-ons advisor and updates are required before it can go public). Therefore, the version numbering used here in the changelog and tagged GitHub releases will match the public release version displayed in the web store.

## Development version

### Bug fixes
* Fixed performance issue where sidebar would freeze, time out, or fail to display when processing a large number of invalid cells. Now sidebar only displays the first 250 invalid cells ([#62](https://github.com/biocore/Keemei/issues/62))

## Version 8 (2016-01-27)

Minor beta release with **experimental** support for validating Qiita sample template files.
Expand Down
2 changes: 2 additions & 0 deletions src/SheetView.gs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function resetSheetView_(sheet) {
var range = sheet.getRange(1, 1, sheet.getMaxRows(), sheet.getMaxColumns());
range.setBackground(Color.RESET);
range.clearNote();
SpreadsheetApp.flush();
};

function renderSheetView_(sheet, report) {
Expand Down Expand Up @@ -51,6 +52,7 @@ function renderSheetView_(sheet, report) {

range.setBackgrounds(state.colors);
range.setNotes(state.notes);
SpreadsheetApp.flush();
};

function initializeState_(numRows, numColumns) {
Expand Down
8 changes: 7 additions & 1 deletion src/Sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@ <h1>Validation report for sheet <b><?= data.sheetName ?></b></h1>
</fieldset>
<fieldset>
<legend>Invalid cells</legend>
<? var displayCellCount = data.cellOrder.length;
if (displayCellCount > data.maxCellDisplay) {
displayCellCount = data.maxCellDisplay; ?>
Displaying only the first <?= data.maxCellDisplay ?> invalid cells. Try fixing some cells and rerunning Keemei.
<br/><br/>
<? } ?>
<div id="accordion">
<? for (var cellIdx = 0; cellIdx < data.cellOrder.length; cellIdx++) {
<? for (var cellIdx = 0; cellIdx < displayCellCount; cellIdx++) {
var a1 = data.cellOrder[cellIdx];
var cellResults = data.validationResults[a1]; ?>
<h3>
Expand Down
2 changes: 2 additions & 0 deletions src/SidebarView.gs
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ function renderSidebarView_(sheet, report) {
errorCount: errorCount,
warningCount: warningCount
},
maxCellDisplay: 250,
cellOrder: cellOrder,
validationResults: validationResults
};

SpreadsheetApp.getUi().showSidebar(sidebar.evaluate()
.setSandboxMode(HtmlService.SandboxMode.IFRAME)
.setTitle("Keemei validation report"));
SpreadsheetApp.flush();
};

function focus(sheetId, a1) {
Expand Down

0 comments on commit 7ec03b3

Please sign in to comment.