-
Notifications
You must be signed in to change notification settings - Fork 13.3k
New Delegate class to boost performance of callbacks previously using std::function #6857
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
base: master
Are you sure you want to change the base?
Conversation
5570305
to
9f14b1d
Compare
@earlephilhower It seems that you are the one taking care of CI. This build is fine except the Mac target has trouble d/l-ing the compiler suite or something at Travis. Is there any user-available way that I could retrigger failed builds without pushing changes to GitHub? |
@dok-net, looked like a temporary network interruption. I'm not sure if the submitter can do it, but next time you can hit the Details link, then on the RHS of the list of Travis-CI jobs there should be a small button you can use to re-run a job. If it's not there, then only the maintainers can and you'll have to wait. Don't sweat a single job failure, we can always re-fire just that job while reviewing code. |
6656bcc
to
afd76b1
Compare
d41bd7a
to
294ecaa
Compare
82dd50f
to
befbd7e
Compare
298899a
to
20ace81
Compare
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 assume this has the same issue with C++17 and implicit copy constructors as the version in SoftwareSerial. plerup/espsoftwareserial#140
Also, these add'l 2,362 lines code don't seem to be used for anything in the core with this PR. Maybe a separate library is the way to go? At the very least some sort of documentation/examples since the only use would be end users' code. OTW it's not really visible to the users.
Once you move on to some of the other pending PRs of mine, you'll find that Delegate and MultiDelegate do get used a lot in core. |
@earlephilhower I've got it building on 64bit Linux now. GCC 9.2 is a serious pain w.r.t. to that warning, I had to copy and check ctors and operator=s without end from one template to another to another, just because it's the only compiler that refuses to infer types easily and allow "using" on ctors and assignment ops without balking. Btw, it's not about C++ 17, GCC 9.2 complains the same for the other C++ releases :-( |
Thanks for the info. I thought the deprecation was related to a C++ standard, but oh well. The version of Delegate.h in SoftwareSerial looks to be building just fine now, thx! |
I'll take a little more time to run whatever use cases I've collected so far, then I will release and PR that. Cooptask on x86_64 Ubuntu needs some work, too. Do you have any timeline for a working EspSoftwareSerial on gcc9.2? I am not 100 percent confident that I haven't broken anything 🙂, and 5 of my pending PRs depend on Delegate/MultiDelegate nowadays.
|
…ecializations. Portability fix for Non-ESP Arduino.
…rop it, it's strictly not necessary.
…ATTR attribute. This affects the unnamed namespace or static non-member functions.
…uto-remove. Invoke returns result of last Delegate call. Caveat: breaks use of event multiplexer with auto-remove; WIP: add iterators.
WIP: remove() during iteration.
…ent operators, needing a lot of code duplication, this commit provides that.
This reverts commit 7c9c23e.
(cherry picked from commit 7c9c23e)
…son of Delegate<> vs. std::function<>
The Delegate class can perform calls at C-function pointer with
void*
argument pair efficiency, while offering the flexibility to simply use lambdas with captures andstd::bind
in the same places without changing the API.or
The ISR handling PR #6047, Schedule.h|cpp adaptation, and WiFi etc. callbacks PR #6782 are updated and waiting to be published.