-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor table and simplify calls #616
Conversation
Codecov Report
@@ Coverage Diff @@
## master #616 +/- ##
==========================================
+ Coverage 98.33% 98.35% +0.01%
==========================================
Files 69 69
Lines 9535 9526 -9
==========================================
- Hits 9376 9369 -7
+ Misses 159 157 -2 |
45c070b
to
98a8d93
Compare
// This pointer is empty most of the time and is used only to keep instance alive in one edge | ||
// case, when start function traps, but instantiate has already modified some elements of a | ||
// shared (imported) table. | ||
std::shared_ptr<Instance> shared_instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a simple way to keep instance alive as long as there is function using it in some table. This was previously achieved by capturing this shared_ptr<Instance>
in std::function
of table element.
Now this looks like an overhead included in each table element every time, but needed only in weird edge case.
But on the other hand, previously there was std::function
's dynamic allocation overhead for each table element all the time, and now this shared_ptr
stays empty in normal cases, so this theoretically should be overall more efficient than before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better now. But I'd still prefer to handle that differently (not necessarily in this PR): either separate start()
from instantiate()
or return tuble Instance*, bool
from instantiate()
.
Clang10 with LTO
|
// This pointer is empty most of the time and is used only to keep instance alive in one edge | ||
// case, when start function traps, but instantiate has already modified some elements of a | ||
// shared (imported) table. | ||
std::shared_ptr<Instance> shared_instance; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better now. But I'd still prefer to handle that differently (not necessarily in this PR): either separate start()
from instantiate()
or return tuble Instance*, bool
from instantiate()
.
b7c4c9a
to
4ab5a58
Compare
AMD EPYC 7601, GCC10, no LTO
|
AMD EPYC 7601, GCC10, LTO
|
4ab5a58
to
74bda14
Compare
|
Pulled out of #615