Commit Graph

28 Commits

Author SHA1 Message Date
Florian Müllner
2b45a01517 cleanup: Use new indentation style for object literals
We have made good progress on object literals as well, although there
are still a lot that use the old style, given how ubiquitous object
literals are.

But the needed reindentation isn't overly intrusive, as changes are
limited to the object literals themselves (i.e. they don't affect
surrounding code).

And given that object literals account for quite a bit of the remaining
differences between regular and legacy rules, doing the transition now
is still worthwhile.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2200>
2022-02-23 12:23:52 +00:00
Florian Müllner
a436226266 scripting: Switch to standard async/await pattern
The original scripting framework was based on SpiderMonkey's
pre-standard generators, and was simply translated to the
corresponding standard syntax when updating it to work with
recent JS versions.

We can do even better by using the standard async/await pattern
instead of generators/yield.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1396
2020-08-12 15:43:38 +00:00
Florian Müllner
ebf77748a8 cleanup: Require "dangling" commas
Since ES5, trailing commas in arrays and object literals are valid.
We generally haven't used them so far, but they are actually a good
idea, as they make additions and removals in diffs much cleaner.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Florian Müllner
07cc84f632 cleanup: Only omit braces for single-line blocks
Braces can be avoided when a block consists of a single statement,
but readability suffers when the statement spans more than a single
line.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Florian Müllner
67ea424525 cleanup: Avoid unnecessary braces
Our coding style has always been to avoid braces when all blocks
are single-lines.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
2019-11-11 19:25:14 +00:00
Marco Trevisan (Treviño)
91eb84fa4e overview: Add OverviewActor and use as main actor of the Overlay
Use the Overview class as controller, while create the actual overlay actor
using a GObject-derived class.

Replace actual properties with getter-only properties.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/559
2019-10-16 15:26:13 +00:00
Florian Müllner
93a461f3f7 perf: Shut up another eslint error
The functions here are asynchronous to handle control back to the
mainloop while waiting for an action to complete, not to run operations
in parallel. That is, the race condition the rule is protecting against
isn't an issue here, so disable the error.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
1e13f32cea style: Disable camelcase rule for GObject properties
For GObject properties, we follow the convention of all-lowercase,
dash-separated names. Those translate to underscores in getters/setters,
so exempt them from the newly added "camelcase" rule.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
e357559582 cleanup: Mark globals used from other modules as exported
eslint cannot figure out that those symbols are used from other modules
via imports, so they trigger unused-variable errors. To fix, explicitly
mark those symbols as exported.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
2f97a1a55d cleanup: Mark unused arguments as unused
This will stop eslint from warning about them, while keeping their
self-documenting benefit.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/627
2019-07-24 00:28:45 +02:00
Florian Müllner
7ac35c644e style: Fix stray/missing spaces
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
2019-07-01 23:44:11 +02:00
Florian Müllner
e56d7f5021 cleanup: Remove unused variables
Spotted by eslint.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/607
2019-07-01 23:44:10 +02:00
Florian Müllner
32baff5906 perf: Use var for METRICS
Each perf module exposes it to the scripting module to report metrics
after all tests have been run. The symbol's scope should allow that,
so declare it as var.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/440
2019-03-21 10:18:02 +00:00
Florian Müllner
46575804cc perf: Stop using legacy generator functions
This was a non-standard Mozilla extension that is no longer supported.
Simply switch to the standardized generator syntax to fix.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/367
2019-01-28 17:29:35 +00:00
Florian Müllner
213e38c2ef cleanup: Use arrow notation for anonymous functions
Arrow notation is great, use it consistently through-out the code base
to bind `this` to anonymous functions, replacing the more overbose
Lang.bind(this, function() {}).

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/23
2018-02-21 13:55:00 +00:00
Owen W. Taylor
e30925995f Make frame-timestamp logging optional
Instead of always logging frame timestamps for every frame - which
was using >26 bytes of memory per frame, or 5MB per hour of continuous
redrawing - make frame timestamps something that defaults off and is
turned turned on using a new ShellGlobal::frame-timestamps property by
the perf scripts.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 10:33:59 -04:00
Owen W. Taylor
f285f2c69f Scripting.createTestWindow(): take params
Take a parameter object rather than a long parameter list containing
multiple booleans.

https://bugzilla.gnome.org/show_bug.cgi?id=732349
2014-06-29 18:27:54 -04:00
Florian Müllner
37da87d9e1 perf: Update to latest overlay changes
Removing tabs from the overview broke the perf test for the
application view; update test to the new method of bringing
it up.

https://bugzilla.gnome.org/show_bug.cgi?id=682109
2012-08-20 20:40:01 +02:00
Cosimo Cecchi
e756c2dbce js: use System.gc() instead of shell_global_gc()
gjs now offers a gc() method in the System module, no need to use our
own.

https://bugzilla.gnome.org/show_bug.cgi?id=679832
2012-07-12 20:11:38 -04:00
Dan Winship
75b824d032 *.js: Make emacs modelines consistent
js2-mode is no longer developed and we recommend js-mode these days,
so switch the modelines to specify that, and make them consistent
across all files.

https://bugzilla.gnome.org/show_bug.cgi?id=660358
2011-10-11 08:05:12 -04:00
Ray Strode
80a9d2e7c9 overview: Make viewSelector private
It's only used internally by the overview itself,
and by some performance testing code, so don't
expose it as a public object.

https://bugzilla.gnome.org/show_bug.cgi?id=657082
2011-08-28 12:23:59 -04:00
Owen W. Taylor
f6fc88cc2d perf: Add metrics for switching to the applications view
Measure how long it takes to switch from the workspaces view to the
windows view the first time and the second time.

https://bugzilla.gnome.org/show_bug.cgi?id=644266
2011-03-11 19:25:40 -05:00
Owen W. Taylor
239aa7b8d5 perf: Add metrics for different window configurations
Add metrics:
 overviewFps5Windows
 overviewFps10Windows
 overviewFps5Maximzed
 overviewFps10Maximized
 overviewFps5Alpha
 overviewFps10Alpha

To have more numbers to show how performance varies with different
numbers of windows and different types of windows (maximized,
with an alpha channel.)

https://bugzilla.gnome.org/show_bug.cgi?id=644265
2011-03-11 19:25:40 -05:00
Owen W. Taylor
821583acae Use gnome-shell-perf-helper to control windows during perf tests
* Run gnome-shell-perf-helper during performance tests
* Use MUTTER_WM_CLASS_FILTER to omit all other windows
* Add new Scripting methods: createTestWindow,
  waitTestWindows, destroyTestWindows
* Create a single 640x480 test window for testing overview
  animation performance.

https://bugzilla.gnome.org/show_bug.cgi?id=644265
2011-03-11 19:21:07 -05:00
Owen W. Taylor
15dd1164b7 [perf] replace frame count with accurately computed frame rate
Compute a frame rate for the period between:

 - User sees first frame of overview animation
 - User sees fully zoomed-out overview

And replace the current Frames count metrics with this. The
previous frame count metrics were actually over the period from
the start of the animation until the window labels finished
animating in; here we are careful to look at a more restricted
period.

https://bugzilla.gnome.org/show_bug.cgi?id=619521
2010-05-26 15:37:27 -04:00
Owen W. Taylor
20d579e7d8 Add units to metrics definitions
Switch from having separate METRICS and METRIC_DESCRIPTIONS objects
in a perf module to a single METRICS array. This is done so the
perf module can define the units for each metric.

In addition to improving the output in the web interface, the purpose
of having units is to give some clue about how to pick from multiple
values from different runs. In particular, with the assumption that
"noise" on the system will increase run times, for time values we want
to pick the smallest values, while for "rate" values, we want to pick
the largest value.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-21 00:18:45 -04:00
Owen W. Taylor
08b8b39a5d Add simple malloc statistics and metrics
Add some basic statistics for allocated memory based on mallinfo(),
and use that to define two metrics:

 usedAfterOverview: bytes used after the overview is shown once
 leakedAfterOverview: additional bytes used when the overview is
   shown a second time.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-21 00:18:45 -04:00
Owen W. Taylor
98c2247c1b Add a facility for automated performance measurement
We want to be able to summarize the behavior of the shell's
performance in a series of "metrics", like the latency between
clicking on the Activities button and seeing a response.

This patch adds the ability to create a script under perf/
in a special format that automates a series of actions in the
shell, writing events to the performance log, then collects
statistics as the log as replayed and turns them into a set
of metrics.

The script is then executed by running as gnome-shell
--perf=<script>.

The 'core' script which is added here will be the primary
performance measurement script that we use for shell performance
regression testing; right now it has a couple of placeholder
metrics.

https://bugzilla.gnome.org/show_bug.cgi?id=618189
2010-05-20 23:41:47 -04:00