This issue tracker is closed. Please visit UPPAAL issue tracker at Github instead.

Bug 492 - rvalue optimizations
Summary: rvalue optimizations
Status: ASSIGNED
Alias: None
Product: UPPAAL
Classification: Unclassified
Component: Engine (show other bugs)
Version: unspecified
Hardware: PC All
: P2 enhancement
Assignee: Marius Mikučionis
URL:
Depends on:
Blocks:
 
Reported: 2010-05-27 12:56 CEST by Marius Mikučionis
Modified: 2019-11-05 14:20 CET (History)
0 users

See Also:
Architecture:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marius Mikučionis 2010-05-27 12:56:25 CEST
Since Uppaal language allows sophisticated type declarations and function calls with those types, I think it would be great to implement some optimizations to avoid creating and copying big blobs in temporary memory and hence gain some performance of already slow virtual machine (no benchmarks for this and I don't really know how Uppaal handles copying of temporary variables, but my experience with integer loops tells me that it is 100x slower than compiled C code).

Here are a few links to get started:
http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/

C++0x way of dealing:
http://thbecker.net/articles/rvalue_references/section_01.html

Visual C++ approach of explaining things:
http://blogs.msdn.com/b/vcblog/archive/2009/02/03/rvalue-references-c-0x-features-in-vc10-part-2.aspx

perhaps it is worth implementing "T&&".
Comment 1 Marius Mikučionis 2019-11-05 14:20:54 CET
The code migrated to C++17, so the move semantics is on by default.

The code needs to be reviewed which classes could benefit.

A brief summary:

The move operators are provided by default if copy ctor/assignment and dtor are not defined. These operators and the destructor need to be noexcept for the `std::vector` to benefit from the move.