[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [platform-swt-dev] Performance hit of Thread.currentThread()
|
FYI - master is open for 4.7
Am 11.06.2016 8:54 vorm. schrieb "Alex Blewitt" <
alex.blewitt@xxxxxxxxx>:
This is great to know. I did some profiling on Win 10, and indeed it does appear that Thread.currentThread() is basically free.
[snip]
In particular you need to ensure that the compiler doesn't optimise the code away (which may be why it's seeming to be instantaneous). In the code the comparison against the currentThread will likely be removed, since the comparison against null is known to be impossible, and since currentThread has no user visible side effects may be optimised away.
> There were some patches that were provided but they weren't accepted due to problems with adding new APIs to the builds not being testable.
Is it worth revisiting this? I'm sure it won't be a 30% performance improvement, since I'd imagine most of the time is getting sunk on the native-code side. But for code that's doing a lot of java-side stuff, if you could cut the overhead of lightweight calls by 30%, that seems worth grabbing.
The patches were a proof of concept and it wasn't worth updating them because of the fact that the "new API" deadline had passed. It will be worth doing this again for 4.7 once the branches are open again.
Alex
ᐧ
_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev