-
Notifications
You must be signed in to change notification settings - Fork 193
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
Fix #4885 - Rewrite MeasureManager in C++ #4920
Conversation
74389ce
to
ae9c047
Compare
….0.0: on unix at least it works wiht localhost, 0.0.0.0 and 127.0.0.1
when "stack too deep" is the err string, the location `rb_eval_string("[email protected]_s");` will fail
The child class Ctor will intialize it
…e MeasureManager too
… fail when calling arguments(model) for an OLD reporting measure
…hread does the actual ruby/python work
@@ -634,63 +614,54 @@ void MeasureManagerServer::handle_post(web::http::http_request message) { | |||
const std::string uri = toString(web::http::uri::decode(message.relative_uri().path())); |
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.
Can message be passed by reference?
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.
Should it be passed by reference is the question. All of the example code passes it by value.
Digging down the source code, this is a PIMPL class. Single member, Source: https://github.com/microsoft/cpprestsdk/blob/9c654889efb6f5bda69fe8f52b3f7d3d3fb56cd8/Release/include/cpprest/http_msg.h#L1573
std::shared_ptr<http::details::_http_request> _m_impl;
So that'd be the size of two pointers (data + control block) right?
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.
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.
Something trivially_copyable should be passed by val if it's < 16 bytes. The reference count needs to be +1 then -1 here since it's not a POD type, but I would reckon the effect is minimal.
TL;DR: I don't think it matters. But if you prefer passing by ref / const ref, we can do that.
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.
Case closed.
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.
I guess it is slightly faster though. Here's a benchmark: https://quick-bench.com/q/gek5jMY8CDeiaU41SZIU30beUjM
Same locally on my ubuntu gcc
@kbenne mac CI has the same crash as I do locally when trying to run a Python measure first THEN a Ruby measure: https://ci.openstudio.net/blue/organizations/jenkins/openstudio-incremental-osx/detail/PR-4920/21/pipeline#step-76-log-7 |
I opened a new issue about this, because I think it is a separate issue from the Measure Manager itself. #4945 |
Definitely not caused by this PR. |
Use `std::fflush(std::cout)` instead of `std::cout << std::flush` Co-authored-by: Julien Marrec <[email protected]>
This issue only pertained to Mac and was occuring when a Python Measure was run before a Ruby Measure. The fix is to set the dlopen flags to RTLD_LOCAL prior to importing OpenStudio in Python. Test OpenStudioCLI.Labs.Run_PythonRuby demonstrates the original issue and will now pass. close #4945
…nStudio into 4885_MeasureManager_c++
CI Results for 22d99c4:
|
Pull request overview
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.