Bug 389057 - warn about QTimer::singleShot(0) performance
Summary: warn about QTimer::singleShot(0) performance
Status: RESOLVED UPSTREAM
Alias: None
Product: clazy
Classification: Developer tools
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Unassigned bugs mailing-list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-01-16 14:23 UTC by Milian Wolff
Modified: 2019-02-15 19:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Milian Wolff 2018-01-16 14:23:47 UTC
See also:

https://codereview.qt-project.org/#/c/216497/

Generally, it should be warned to not use QTimer::singleShot(0, Functor), as that cannot be optimized easily. It should instead use QTimer::singleShot(0, ctx, Functor);
Comment 1 Sergio Martins 2018-02-10 21:24:04 UTC
Is this still relevant with all your patches ?
Comment 2 Milian Wolff 2018-02-14 10:00:24 UTC
no, once the patches get in we can ignore this. Does clazy know about the used Qt version? If so, it could warn about this in older Qt versions. Low-prio of course
Comment 3 Sergio Martins 2019-02-15 19:26:40 UTC
Let's tackle this in Qt instead.

And anyway clazy already warns if you don't pass a context object, as that can bring threading bugs or crashes. Also, the general feeling is to deprecate the connect() taking only 3 args, and forcing people to use context obj, even with lambdas/functor.