Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Issue 292873002: make debug mode ~20% faster on linux (Closed)

Created:
6 years, 7 months ago by hubbe
Modified:
6 years, 7 months ago
Reviewers:
Mark Mentovai, piman
CC:
chromium-reviews, erikwright+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

make debug mode ~20% faster on linux I was doing some benchmarking on tests on linux, and noticed that 10-20% of time was in ThreadCheckerImpl::CalledOnValidThread. I looked into it and found that we're doing a syscall to get the thread ID, which is not needed on any platform where pthread_t is already an integer type. Replacing that syscall with pthread_self() makes this particular test (End2EndTest.BasicFakeSoftwareVideo) go from 488ms to 374ms, which is a 20% speedup. While other tests might not use ThreadChecker quite as much, it should still be a pretty good win across a large set of tests. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272725

Patch Set 1 #

Patch Set 2 : odd dcheck removed #

Total comments: 2

Patch Set 3 : Actually works now I think #

Patch Set 4 : win fix #

Total comments: 6

Patch Set 5 : Comment updated #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -28 lines) Patch
M base/synchronization/lock.h View 1 2 1 chunk +1 line, -5 lines 0 comments Download
M base/synchronization/lock.cc View 1 2 1 chunk +6 lines, -15 lines 0 comments Download
M base/threading/platform_thread.h View 1 2 3 4 2 chunks +40 lines, -0 lines 0 comments Download
M base/threading/platform_thread_posix.cc View 1 2 1 chunk +6 lines, -1 line 0 comments Download
M base/threading/platform_thread_win.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M base/threading/thread_checker_impl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M base/threading/thread_checker_impl.cc View 1 2 2 chunks +6 lines, -6 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
hubbe
6 years, 7 months ago (2014-05-19 22:16:07 UTC) #1
jam
cool; although I'm not really a good reviewer as I'm not that familiar with posix. ...
6 years, 7 months ago (2014-05-20 04:33:22 UTC) #2
piman
https://codereview.chromium.org/292873002/diff/20001/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (right): https://codereview.chromium.org/292873002/diff/20001/base/threading/platform_thread_posix.cc#newcode152 base/threading/platform_thread_posix.cc:152: return pthread_self(); On my system, PlatformThreadId (a pid_t currently) ...
6 years, 7 months ago (2014-05-20 05:09:22 UTC) #3
hubbe
PTAL So I tried changing PlatformThreadId to a pthraed_t and ran into a bunch of ...
6 years, 7 months ago (2014-05-21 00:22:06 UTC) #4
piman
LGTM fwiw, I'm not owner. There's probably a ton of places that would benefit from ...
6 years, 7 months ago (2014-05-21 00:55:24 UTC) #5
hubbe
https://codereview.chromium.org/292873002/diff/60001/base/synchronization/lock.cc File base/synchronization/lock.cc (right): https://codereview.chromium.org/292873002/diff/60001/base/synchronization/lock.cc#newcode24 base/synchronization/lock.cc:24: DCHECK(owning_thread_ref_ == PlatformThread::CurrentRef()); On 2014/05/21 00:55:24, piman wrote: > ...
6 years, 7 months ago (2014-05-21 04:27:35 UTC) #6
hubbe
+mark
6 years, 7 months ago (2014-05-21 04:36:30 UTC) #7
Mark Mentovai
The CL description says “make debug mode ~20% faster on linux” but this change helps ...
6 years, 7 months ago (2014-05-23 17:55:16 UTC) #8
hubbe
From the look of things, this will only make a difference for linux derivatives (linux, ...
6 years, 7 months ago (2014-05-23 19:31:14 UTC) #9
Mark Mentovai
LGTM
6 years, 7 months ago (2014-05-23 20:28:48 UTC) #10
hubbe
The CQ bit was checked by hubbe@chromium.org
6 years, 7 months ago (2014-05-23 21:26:03 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/hubbe@chromium.org/292873002/80001
6 years, 7 months ago (2014-05-23 21:26:53 UTC) #12
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). Please consider checking whether the failures are ...
6 years, 7 months ago (2014-05-24 02:22:28 UTC) #13
commit-bot: I haz the power
6 years, 7 months ago (2014-05-24 12:53:35 UTC) #14
Message was sent while issue was closed.
Change committed as 272725

Powered by Google App Engine
This is Rietveld 408576698