Граф коммитов

163 Коммитов

Автор SHA1 Сообщение Дата
Doug Thayer cc57ad9bcb Bug 1587112 - Make asserts in StartupCache::LoadArchive explicit r=njn
There is no behavior change here - these asserts were previously being hit
inside the operator+ of RangedPtr, but this makes them explicit.

Differential Revision: https://phabricator.services.mozilla.com/D49985

--HG--
extra : moz-landing-system : lando
2019-10-22 03:15:18 +00:00
Doug Thayer 8ef17f5f9f Bug 1586744 - Explicitly track StartupCache table's memory r=njn
This was not being fully tracked as a result of bug 1550108.

Differential Revision: https://phabricator.services.mozilla.com/D49017

--HG--
extra : moz-landing-system : lando
2019-10-16 15:41:54 +00:00
Doug Thayer aa100ca679 Bug 1587107 - Increase StartupCache bg thread stack sizes r=njn
In bug 1550108 we added a thread to prefetch the contents of the
startup cache file, and as part of that we reduced its stack size
and the stack size of the thread which writes the file. However
it seems we set the write thread's stack size too low.

Differential Revision: https://phabricator.services.mozilla.com/D48570

--HG--
extra : moz-landing-system : lando
2019-10-10 05:39:15 +00:00
Doug Thayer c93f700860 Bug 1550108 - Reduce stack size on StartupCache threads r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46225

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:41 +00:00
Doug Thayer e64355e5cd Bug 1550108 - Prefetch StartupCache off main thread r=froydnj
Does what it says on the tin. Once we have a central scheduling
system this should likely just consume that.

Differential Revision: https://phabricator.services.mozilla.com/D35454

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:32 +00:00
Doug Thayer 87f736bc12 Bug 1550108 - Compact the StartupCache if it is bloated r=froydnj
The first run loads more things into the StartupCache than are
used on the second and subsequent runs. This just ensures that if
the StartupCache diverges too far from its actual use that we will
rebuild it.

Differential Revision: https://phabricator.services.mozilla.com/D34654

--HG--
extra : moz-landing-system : lando
2019-10-04 20:45:18 +00:00
Doug Thayer a74957c6e6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

Differential Revision: https://phabricator.services.mozilla.com/D34652

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:59 +00:00
Doug Thayer 47ada02be2 Bug 1550108 - Avoid decompressing entries just to check if they exist r=kmag
This will not behave exactly the same if we had previously written bad
data for the entry that would fail to decompress. I imagine this is rare
enough, and the consequences are not severe enough, that this should be
fine.

Differential Revision: https://phabricator.services.mozilla.com/D30643

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:32 +00:00
Doug Thayer 05e64f1f70 Bug 1550108 - Don't read from app/gre caches in StartupCache r=kmag
I thought I had already written out the patch to remove these, but
apparently not. Per discussion in the startup cache telemetry bug,
there should be no reason for doing this.

Differential Revision: https://phabricator.services.mozilla.com/D31491

--HG--
extra : moz-landing-system : lando
2019-10-04 20:44:18 +00:00
Cosmin Sabou 14938bad3b Backed out 10 changesets (bug 1550108) for causing build bustages on StartupCache.cpp.
Backed out changeset cbadfa2bbd7e (bug 1550108)
Backed out changeset 2560f0ab6ebf (bug 1550108)
Backed out changeset 0a1fa8d8bb3c (bug 1550108)
Backed out changeset 62416909cf67 (bug 1550108)
Backed out changeset 60991713b1e2 (bug 1550108)
Backed out changeset f950e30afd90 (bug 1550108)
Backed out changeset e63d0a1fec38 (bug 1550108)
Backed out changeset 7a009d42e7e7 (bug 1550108)
Backed out changeset 395affa4c205 (bug 1550108)
Backed out changeset 0fd41e9dbd2a (bug 1550108)

--HG--
rename : mfbt/lz4/lz4.c => mfbt/lz4.c
rename : mfbt/lz4/lz4.h => mfbt/lz4.h
2019-09-29 01:14:31 +03:00
Doug Thayer 4fce63cac2 Bug 1550108 - Reduce stack size on StartupCache threads r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D46225

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:23 +00:00
Doug Thayer 8d6b517ecd Bug 1550108 - Prefetch StartupCache off main thread r=froydnj
Does what it says on the tin. Once we have a central scheduling
system this should likely just consume that.

Differential Revision: https://phabricator.services.mozilla.com/D35454

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:21 +00:00
Doug Thayer 4187f5ece3 Bug 1550108 - Compact the StartupCache if it is bloated r=froydnj
The first run loads more things into the StartupCache than are
used on the second and subsequent runs. This just ensures that if
the StartupCache diverges too far from its actual use that we will
rebuild it.

Differential Revision: https://phabricator.services.mozilla.com/D34654

--HG--
extra : moz-landing-system : lando
2019-09-27 18:17:17 +00:00
Doug Thayer eb024f4ee6 Bug 1550108 - Change StartupCache format from zip to custom r=froydnj
I am not aware of anything that depends on StartupCache being a
zip file, and since I want to use lz4 compression because inflate
is showing up quite a lot in profiles, it's simplest to just use
a custom format. This loosely mimicks the ScriptPreloader code,
with a few diversions:

- Obviously the contents of the cache are compressed. I used lz4
  for this as I hit the same file size as deflate at a compression
  level of 1, which is what the StartupCache was using previously,
  while decompressing an order of magnitude faster. Seemed like
  the most conservative change to make. I think it's worth
  investigating what the impact of slower algs with higher ratios
  would be, but for right now I settled on this. We'd probably
  want to look at zstd next.
- I use streaming compression for this via lz4frame. This is not
  strictly necessary, but has the benefit of not requiring as
  much memory for large buffers, as well as giving us a built-in
  checksum, rather than relying on the much slower CRC that we
  were doing with the zip-based approach.
- I coded the serialization of the headers inline, since I had to
  jump back to add the offset and compressed size, which would
  make the nice Code(...) method for the ScriptPreloader stuff
  rather more complex. Open to cleaner solutions, but moving it
  out just felt like extra hoops for the reader to jump through
  to understand without the benefit of being more concise.

Differential Revision: https://phabricator.services.mozilla.com/D34652

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:35 +00:00
Doug Thayer 5f9554635c Bug 1550108 - Avoid decompressing entries just to check if they exist r=kmag
This will not behave exactly the same if we had previously written bad
data for the entry that would fail to decompress. I imagine this is rare
enough, and the consequences are not severe enough, that this should be
fine.

Differential Revision: https://phabricator.services.mozilla.com/D30643

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Doug Thayer 5775d5e284 Bug 1550108 - Don't read from app/gre caches in StartupCache r=kmag
I thought I had already written out the patch to remove these, but
apparently not. Per discussion in the startup cache telemetry bug,
there should be no reason for doing this.

Differential Revision: https://phabricator.services.mozilla.com/D31491

--HG--
extra : moz-landing-system : lando
2019-09-27 22:15:01 +00:00
Mike Conley ddb4502ec8 Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-21 17:32:45 +00:00
Andreea Pavel 846e7d0d9b Backed out 2 changesets (bug 1544037) for build bustages at StartupCache.cpp on a CLOSED TREE
Backed out changeset 8242c6c52f6c (bug 1544037)
Backed out changeset c19e86931d1a (bug 1544037)
2019-05-21 17:06:26 +03:00
Mike Conley 8cfb70661e Bug 1544037 - Skip exists check when trying to open startupcache zip file archive. r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D31086

--HG--
extra : moz-landing-system : lando
2019-05-16 18:53:59 +00:00
Gijs Kruitbosch 8ea5584575 Bug 1543970 - give up removing the startup cache file from the previous profile location after 6 years, r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D27280

--HG--
extra : moz-landing-system : lando
2019-04-12 14:07:40 +00:00
Doug Thayer 55db157391 Bug 1364235 - Collect telemetry stats on startup cache hits and misses r=kmag
In bug 1264235 we have some indication that observed bugs with the
startup cache might have been resolved, but we don't really know
until we collect data. Collecting these stats will give us the
ability to have more certainty that the startup cache is functioning
correctly in the wild.

Differential Revision: https://phabricator.services.mozilla.com/D19573

--HG--
extra : moz-landing-system : lando
2019-03-05 16:52:57 +00:00
Ehsan Akhgari e5e885ae31 Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre
# ignore-this-changeset

--HG--
extra : amend_source : 7221c8d15a765df71171099468e7c7faa648f37c
extra : histedit_source : a0cce6015636202bff09e35a13f72e03257a7695
2019-01-18 10:16:18 +01:00
Sylvestre Ledru 265e672179 Bug 1511181 - Reformat everything to the Google coding style r=ehsan a=clang-format
# ignore-this-changeset

--HG--
extra : amend_source : 4d301d3b0b8711c4692392aa76088ba7fd7d1022
2018-11-30 11:46:48 +01:00
Gabriele Svelto 266ef73c96 Bug 1503207 - Remove nsWeakPtr.h and cleanup all files including weak reference-related headers r=froydnj
Differential Revision: https://phabricator.services.mozilla.com/D10251

--HG--
extra : moz-landing-system : lando
2018-10-31 20:39:03 +00:00
Andrew McCreight 837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D6861

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Emilio Cobos Álvarez fffb25b74f Bug 1465585: Switch from mozilla::Move to std::move. r=froydnj
This was done automatically replacing:

  s/mozilla::Move/std::move/
  s/ Move(/ std::move(/
  s/(Move(/(std::move(/

Removing the 'using mozilla::Move;' lines.

And then with a few manual fixups, see the bug for the split series..

MozReview-Commit-ID: Jxze3adipUh
2018-06-01 10:45:27 +02:00
Eric Rahm 0e7bb34ef8 Bug 1439047 - Part 2: Cleanup StartupCache::PutBuffer hashtable usage. r=froydnj
This switches over to using `LookupForAdd` which allows us to avoid a second
lookup when adding the entry. Addtionally `nsDependentCString` is used to
avoid copying the id string when looking up the entry.

--HG--
extra : rebase_source : 2dbb54fb992f4c79347150198af61438ee5b4eec
extra : source : 718961d941d4d495426e59c6b5044302059489f9
2018-02-16 15:58:30 -08:00
Eric Rahm 7337adec45 Bug 1439047 - Part 1: Make StartupCache::PutBuffer take ownership of the buffer. r=froydnj
This avoids a redundant alloc and copy in `PutBuffer`. All existing callers
were destroying the passed in buffer after the call.

--HG--
extra : rebase_source : 065505219d70d26bad49c7eba2cec8edf0e9939d
extra : amend_source : 118eddad4dc901da02817c788fb98f6f4c85a3f0
extra : source : 7f0cedfb4bd85bfe1a523168019864c9c6c0e665
2018-02-16 15:30:47 -08:00
Narcis Beleuzu 01dffd73eb Backed out 2 changesets (bug 1439047) for Android build bustages. CLOSED TREE
Backed out changeset 718961d941d4 (bug 1439047)
Backed out changeset 7f0cedfb4bd8 (bug 1439047)
2018-02-24 01:10:22 +02:00
Eric Rahm 340c6c4613 Bug 1439047 - Part 2: Cleanup StartupCache::PutBuffer hashtable usage. r=froydnj
This switches over to using `LookupForAdd` which allows us to avoid a second
lookup when adding the entry. Addtionally `nsDependentCString` is used to
avoid copying the id string when looking up the entry.

--HG--
extra : rebase_source : e929431b4ab277345e455fb0b220a8aa6839b37f
2018-02-16 15:58:30 -08:00
Eric Rahm 8b8acc64f2 Bug 1439047 - Part 1: Make StartupCache::PutBuffer take ownership of the buffer. r=froydnj
This avoids a redundant alloc and copy in `PutBuffer`. All existing callers
were destroying the passed in buffer after the call.

--HG--
extra : rebase_source : 39a21686becedf32c38e58fa832ae47845b2f5e0
2018-02-16 15:30:47 -08:00
Andrew McCreight 09ab49e463 Bug 1410471 - Remove StartupCacheWrapper and friends. r=froydnj
This class was needed for testing, but no longer.

MozReview-Commit-ID: AIk0kKlbScs

--HG--
extra : rebase_source : 35eed188e44dc4c9899479b35882461dd2cf4624
2017-10-20 10:40:50 -07:00
Andrew McCreight 5738242a26 Bug 1408017 - Clear gStartupCacheWrapper in the dtor. r=froydnj 2017-10-26 16:47:27 -04:00
Kris Maglione 257d9118dc Bug 1409249: Require singleton constructors to return explicit already_AddRefed. r=froydnj
Right now, NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR expects singleton
constructors to return already-addrefed raw pointers, and while it accepts
constructors that return already_AddRefed, most existing don't do so.

Meanwhile, the convention elsewhere is that a raw pointer return value is
owned by the callee, and that the caller needs to addref it if it wants to
keep its own reference to it.

The difference in convention makes it easy to leak (I've definitely caused
more than one shutdown leak this way), so it would be better if we required
the singleton getters to return an explicit already_AddRefed, which would
behave the same for all callers.


This also cleans up several singleton constructors that left a dangling
pointer to their singletons when their initialization methods failed, when
they released their references without clearing their global raw pointers.

MozReview-Commit-ID: 9peyG4pRYcr

--HG--
extra : rebase_source : 2f5bd89c17cb554541be38444672a827c1392f3f
2017-10-16 21:08:42 -07:00
Kris Maglione 4a767c7e6e Bug 1404198: Part 2j - Switch to NS_NewTimer* everywhere else. r=njn
MozReview-Commit-ID: LmGIgfmNSmk

--HG--
extra : rebase_source : bf34e852beb0c8f6eafd09184c2e0cda95f95f83
2017-09-24 19:57:48 -07:00
Nicholas Nethercote 8a68e6fb83 Bug 1403868 (part 4) - Reduce tools/profiler/public/*.h to almost nothing in non-MOZ_GECKO_PROFILER builds. r=mstange.
Currently the Gecko Profiler defines a moderate amount of stuff when
MOZ_GECKO_PROFILER is undefined. It also #includes various headers, including
JS ones. This is making it difficult to separate Gecko's media stack for
inclusion in Servo.

This patch greatly simplifies how things are exposed. The starting point is:

- GeckoProfiler.h can be #included unconditionally;

- everything else from the profiler must be guarded by MOZ_GECKO_PROFILER.

In practice this introduces way too many #ifdefs, so the patch loosens it by
adding no-op macros for a number of the most common operations.

The net result is that #ifdefs and macros are used a bit more, but almost
nothing is exposed in non-MOZ_GECKO_PROFILER builds (including
ProfilerMarkerPayload.h and GeckoProfiler.h), and understanding what is exposed
is much simpler than before.

Note also that in BHR, ThreadStackHelper is now entirely absent in
non-MOZ_GECKO_PROFILER builds.
2017-10-04 09:11:18 +11:00
Sylvestre Ledru 4e9cf83ee8 Bug 1378712 - Remove all trailing whitespaces r=Ehsan
MozReview-Commit-ID: Kdz2xtTF9EG

--HG--
extra : rebase_source : 7235b3802f25bab29a8c6ba40a181a722f3df0ce
2017-07-06 14:00:35 +02:00
Nicholas Nethercote 58786e1ea7 Bug 1375392 - Tweak the PROFILER_LABEL* macros. r=mstange.
This patch makes the following changes to the macros.

- Removes PROFILER_LABEL_FUNC. It's only suitable for use in functions outside
  classes, due to PROFILER_FUNCTION_NAME not getting class names, and it was
  mostly misused.

- Removes PROFILER_FUNCTION_NAME. It's no longer used, and __func__ is
  universally available now anyway.

- Combines the first two string literal arguments of PROFILER_LABEL and
  PROFILER_LABEL_DYNAMIC into a single argument. There was no good reason for
  them to be separate, and it forced a '::' in the label, which isn't always
  appropriate. Also, the meaning of the "name_space" argument was interpreted
  in an interesting variety of ways.

- Adds an "AUTO_" prefix to PROFILER_LABEL and PROFILER_LABEL_DYNAMIC, to make
  it clearer they construct RAII objects rather than just being function calls.
  (I myself have screwed up the scoping because of this in the past.)

- Fills in the 'js::ProfileEntry::Category::' qualifier within the macro, so
  the caller doesn't need to. This makes a *lot* more of the uses fit onto a
  single line.

The patch also makes the following changes to the macro uses (beyond those
required by the changes described above).

- Fixes a bunch of labels that had gotten out of sync with the name of the
  class and/or function that encloses them.

- Removes a useless PROFILER_LABEL use within a trivial scope in
  EventStateManager::DispatchMouseOrPointerEvent(). It clearly wasn't serving
  any useful purpose. It also serves as extra evidence that the AUTO_ prefix is
  a good idea.

- Tweaks DecodePool::SyncRunIf{Preferred,Possible} so that the labelling is
  done within them, instead of at their callsites, because that's a more
  standard way of doing things.

--HG--
extra : rebase_source : 318d1bc6fc1425a94aacbf489dd46e4f83211de4
2017-06-22 17:08:53 +10:00
Nicholas Nethercote 033f83145c Bug 1375387 - Reorder and section-ify GeckoProfiler.h. r=mstange.
This patch gives some structure and order to the profiler's API.

It also renames AutoProfilerRegister as AutoProfilerRegisterThread, to match
profiler_register_thread().
2017-06-22 14:28:47 +10:00
Wes Kocher 6c1a0ae549 Backed out 6 changesets (bug 1371699) for various failures including frequent img-blobURI-2.html failures and leaks a=backout
Backed out changeset 67a27cf0ab80 (bug 1371699)
Backed out changeset 7e494fa90087 (bug 1371699)
Backed out changeset 30405ec37e1e (bug 1371699)
Backed out changeset 2d67624a01dc (bug 1371699)
Backed out changeset 503c9d22e6bb (bug 1371699)
Backed out changeset eedcb67a9fb6 (bug 1371699)

MozReview-Commit-ID: 4HydLjK7Ond
2017-06-13 17:50:11 -07:00
Boris Zbarsky 3d884086c3 Bug 1371699 part 3. Make nsIStringInputStream not inherit from nsIInputStream anymore. r=bkelly
This will prevent ambiguous nsIInputStream inheritance once we also inherit from nsIAsyncInputStream.
2017-06-13 16:16:23 -04:00
Cervantes Yu cc5836fbae Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
NS_SetCurrentThreadName() is added as an alternative to PR_SetCurrentThreadName()
inside libxul. The thread names are collected in the form of crash annotation to
be processed on socorro.

MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Sebastian Hengst 1828ea89ca Backed out changeset 7fdcabdbb675 (bug 1024669) for failing mda, GTest and talos jobs. r=backout on a CLOSED TREE 2017-04-10 19:05:44 +02:00
Cervantes Yu 364e524eca Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
Carsten "Tomcat" Book 02ddc23c74 Backed out changeset 7a52d887bcea (bug 1024669) for bustage 2017-04-10 11:43:49 +02:00
Cervantes Yu ece1ce1a7d Bug 1024669 - Part 1: Annotate crash reports with thread names. r=gsvelto
MozReview-Commit-ID: 4RpAWzTuvPs
2017-02-07 18:57:23 +08:00
David Major ed0b8f8653 Bug 1344615: Remove nsXPCOMStrings.{h,cpp} r=bsmedberg
These are now dead code.

MozReview-Commit-ID: AClU0Qx3kmN

--HG--
extra : rebase_source : df83cf89292da1519bb26027c11e14923d5c54a0
2017-03-06 17:52:54 +13:00
Bill McCloskey 0cda76d680 Bug 1339289 - Give names to a lot of common timers (r=ehsan)
MozReview-Commit-ID: IMsv5bkyjBL
2017-02-15 12:30:01 -08:00
Barun Parruck 41ebbcb918 Bug 1334796 : Removes redundant return statement in void function r=froydnj
MozReview-Commit-ID: 1EkMIiXMtjf

--HG--
extra : rebase_source : ea6d5e7617bb7b35c4029d16b2ccca07bba39660
2017-01-29 06:25:51 +05:30
Markus Stange 4bdc4ca0fb Bug 1323100 - Register most of the remaining threadfunc threads with the profiler. r=froydnj
As far as I can tell, this covers all the remaining threads which we start
using PR_CreateThread, except the ones that are created inside NSPR or NSS,
and except for the Shutdown Watchdog thread in nsTerminator.cpp and the
CacheIO thread. The Shutdown Watchdog thread stays alive past leak detection
during shutdown (by design), so we'd report leaks if we profiled it. The
CacheIO thread seems to stay alive past shutdown leak detection sometimes as
well.

This adds a AutoProfilerRegister stack class for easy registering and
unregistering. There are a few places where we still call
profiler_register_thread() and profiler_unregister_thread() manually, either
because registration happens conditionally, or because there is a variable that
gets put on the stack before the AutoProfilerRegister (e.g. a dynamically
generated thread name). AutoProfilerRegister needs to be the first object on
the stack because it uses its own `this` pointer as the stack top address.

MozReview-Commit-ID: 3vwhS55Yzt

--HG--
extra : rebase_source : 56dd27282e7bd09a7e7dc7ca09ccfe3a0198e7af
2017-01-05 16:34:26 +01:00