Hi,
I have developed a custom PortObject to hold a load of records that is not in table format.
My problem is that when running a node with a custom port the org.knime.core.node class's execute method forces the port to make a copy of itself (calling the copyPortObject method and thus invoking the port's serialize/deserialize mechanism). This is in contrast to a BufferedDataTable where the reference is reassigned (snippet below from org.knime.core.node with my annotations) :-
if (data[i] == null) { // optional inputinData[i] = null; // (checked above) } else if (data[i] instanceof BufferedDataTable) { inData[i] = data[i]; //I want to assign a reference to my object... } else { //...rather than make a copy of it exec.setMessage("Copying input object at port " + i); ExecutionMonitor subExec = exec.createSubProgress(0.0); try { inData[i] = copyPortObject(data[i], subExec); } catch (CanceledExecutionException e) { createWarningMessageAndNotify("Execution canceled"); return false; } catch (Throwable e) { createErrorMessageAndNotify("Unable to clone input data " + "at port " + i + ": " + e.getMessage(), e); return false; } }</pre>
The necessary creation of a copy of the port object presents a huge performance impact for me (particularly in loops!) due to the serialize/deserialize - I'd like to find some way around this, but unless I'm missing something I have to get a copy rather than a reference to the data in the custom port object.
Any advice on how to get round this and/or any chance this feature can be looked at in future.