diff options
author | Björn Gustavsson <[email protected]> | 2013-07-01 09:05:37 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2013-09-03 16:00:15 +0200 |
commit | df7bb30fd0e8161e5146705fd117aa0bb115fbe7 (patch) | |
tree | fad34f34add6e9822052a513c4524cdf4f47e311 /lib/inets/doc | |
parent | eb49ee71f0751cf54bc39f9971f389c92525b0a4 (diff) | |
download | otp-df7bb30fd0e8161e5146705fd117aa0bb115fbe7.tar.gz otp-df7bb30fd0e8161e5146705fd117aa0bb115fbe7.tar.bz2 otp-df7bb30fd0e8161e5146705fd117aa0bb115fbe7.zip |
PER, UPER: Optimize table constraints
The generated code for table constraints has several problems:
* For each object set, a function for getting an encoding or decoding
fun is generated, regardless of whether it is actually used. In many
specifications, the object set actually used is the union of several
other object sets. That means that the code can become a lot bulkier
than it would need to be.
* The funs are not necessary. The funs just add to the code bloat
and generate more unnecessary garbage at run-time. Also, one of
the arguments of the fun is the name of the field in the class which
is known at compile-time, and the fun for decoding has unused arguments.
How to fix the problems:
At each call site where an open type should be encoded/decoded, call a
specific generated function specialized for the actual object set and
the name of the field in the class. When generating the specialized
functions, make sure that we re-use a previously generated function if
possible.
Diffstat (limited to 'lib/inets/doc')
0 files changed, 0 insertions, 0 deletions