Google drive api 谷歌电子表格批量更新非常慢
我正在更新谷歌电子表格,更新100个单元格大约需要30秒。 我正在使用下面的答案中描述的代码Google drive api 谷歌电子表格批量更新非常慢,google-drive-api,google-docs-api,gdata-api,google-spreadsheet-api,Google Drive Api,Google Docs Api,Gdata Api,Google Spreadsheet Api,我正在更新谷歌电子表格,更新100个单元格大约需要30秒。 我正在使用下面的答案中描述的代码 这正常吗?这似乎非常缓慢,几乎不可能处理。有没有加快这个过程的方法?答案在提供的 我改变了: private CellEntry createUpdateOperation(URL cellFeedUrl, int row, int col, String value) throws ServiceException, IOException { String batchId = "R" +
这正常吗?这似乎非常缓慢,几乎不可能处理。有没有加快这个过程的方法?答案在提供的
我改变了:
private CellEntry createUpdateOperation(URL cellFeedUrl, int row, int col, String value) throws ServiceException, IOException {
String batchId = "R" + row + "C" + col;
URL entryUrl = new URL(cellFeedUrl.toString() + "/" + batchId);
CellEntry entry = this.service.getEntry(entryUrl, CellEntry.class);
entry.changeInputValueLocal(value);
BatchUtils.setBatchId(entry, batchId);
BatchUtils.setBatchOperationType(entry, BatchOperationType.UPDATE);
return entry;
}
进入:
现在在+/-20秒内编辑了300个单元格,这样更好…快速批量更新答案如下:小工作表更快:写入速度受工作表大小的影响。即使只更改图纸中的一个单元格,大型图纸也会变慢。整个speadsheet的大小影响不大,但是sheet的大小很重要。请将答案放在答案框中,将问题放在问题框中,谢谢。问题是:为什么它们这么慢?API怎么会这么慢?
private CellEntry createUpdateOperation(URL cellFeedUrl, int row, int col, String value) throws ServiceException, IOException {
String batchId = "R" + row + "C" + col;
CellEntry batchEntry = new CellEntry(row, col, value);
batchEntry.setId(String.format("%s/%s", cellFeedUrl.toString(), batchId));
BatchUtils.setBatchId(batchEntry, batchId);
BatchUtils.setBatchOperationType(batchEntry, BatchOperationType.UPDATE);
return batchEntry;
}