mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 16:49:06 +01:00
Transfer notebook output as VSBuffer (#130452)
* Transfer notebook output data as a VSBuffer This PR transfers notebook output as an VSBuffer instead of as a array of numbers. This significantly reduces the message size as well as the serialize/deserialize times To accomplish this, I've introduced a new `SerializableObjectWithBuffers` type. This specially marks rpc objects that contain VSBuffers. This is needed as our current RPC implementation can only efficently transfer VSBuffers that appears as top level arguments. The rpcProtocol now can also identify top level `SerializableObjectWithBuffers` arguments and ensure these are serialized more efficently. This is easier than trying to extract the `VSBuffer` proeprties to top level arguments. It also lets us easily support return types that may contain buffers * use SerializableObjectWithBuffers when dealing with (old) notebook controllers Co-authored-by: Johannes Rieken <johannes.rieken@gmail.com>
This commit is contained in:
@@ -21,6 +21,7 @@ import { NotebookCellOutput } from 'vs/workbench/api/common/extHostTypes';
|
||||
import { asWebviewUri } from 'vs/workbench/api/common/shared/webview';
|
||||
import { CellExecutionUpdateType } from 'vs/workbench/contrib/notebook/common/notebookExecutionService';
|
||||
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
|
||||
import { SerializableObjectWithBuffers } from 'vs/workbench/services/extensions/common/proxyIdentifier';
|
||||
import * as vscode from 'vscode';
|
||||
|
||||
interface IKernelData {
|
||||
@@ -362,7 +363,7 @@ class NotebookCellExecutionTask extends Disposable {
|
||||
|
||||
private async update(update: ICellExecuteUpdateDto | ICellExecuteUpdateDto[]): Promise<void> {
|
||||
const updates = Array.isArray(update) ? update : [update];
|
||||
return this._proxy.$updateExecutions(updates);
|
||||
return this._proxy.$updateExecutions(new SerializableObjectWithBuffers(updates));
|
||||
}
|
||||
|
||||
private verifyStateForOutput() {
|
||||
|
||||
Reference in New Issue
Block a user