|
|
|
|||||
|
Expensive return by value
I have a server-side method that returns a sequence to the client:
Code:
sequence<Position> PositionList;
interface ServerOps {
PositionList GetPositions();
};
Is it possible to return a smart pointer instead? If not, what other solutions exist? |
|
||||||
|
If you can take advantage of "named return value optimization" (NRVO), this return copy will be optimized out.
If you can't, you could use AMD (asynchronous method dispatch) in your server for this operation. The "return" parameter becomes an "in" parameter on the AMD callback. Best regards, Bernard |
|
||||||
|
Note that this topic, and others, were covered in my article "Optimizing Performance of File Transfers " in http://www.zeroc.com/newsletter/issue20.pdf
|
|
|||||
|
How does this help? A copy of the SharedPositionList will be returned which will contain a COPY of PositionList.
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| In AMI ,why did not foo_async return ? | AaronIct | Help Center | 3 | 04-12-2007 05:03 AM |
| About return struct | billwillman | Help Center | 7 | 10-16-2006 03:39 AM |
| Why does the function of checkedCast() return 0??? | OliveGirl | Help Center | 1 | 05-25-2006 04:52 AM |
| why return false ? | OrNot | Help Center | 2 | 01-04-2006 02:50 AM |
| return value of getPropertyAsInt | n2503v | Help Center | 3 | 10-19-2005 05:58 PM |