mirror of
https://github.com/servo/servo.git
synced 2025-08-27 08:08:19 +01:00
tests: Vendor blink perf tests (#38654)
Vendors the [blink perf tests](https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/). These perf tests are useful to evaluate the performance of servo. The license that governs the perf tests is included in the folder. Running benchmark cases automatically is left to future work. The update.py script is taken from mozjs and slightly adapted, so we can easily filter (and patch if this should be necessary in the future. Testing: This PR just adds the perf_tests, but does not use or modify them in any way. --------- Signed-off-by: Jonathan Schwender <schwenderjonathan@gmail.com>
This commit is contained in:
parent
7621332824
commit
ee781b71b4
648 changed files with 359694 additions and 0 deletions
|
@ -14,6 +14,7 @@ files = [
|
|||
# Upstream code from Khronos/WebGL uses tabs for indentation
|
||||
"./tests/wpt/webgl/tests",
|
||||
# Vendored from upstream
|
||||
"./tests/blink_perf_tests/perf_tests",
|
||||
"./tests/wpt/webgpu/tests",
|
||||
# Our import script is not currently respecting the lint.
|
||||
"./tests/wpt/webgl/tools/import-conformance-tests.py",
|
||||
|
|
967
tests/blink_perf_tests/LICENSE_FOR_ABOUT_CREDITS
Normal file
967
tests/blink_perf_tests/LICENSE_FOR_ABOUT_CREDITS
Normal file
|
@ -0,0 +1,967 @@
|
|||
(WebKit doesn't distribute an explicit license. This LICENSE is derived from
|
||||
license text in the source.)
|
||||
|
||||
Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
|
||||
2006, 2007 Alexander Kellett, Alexey Proskuryakov, Alex Mathews, Allan
|
||||
Sandfeld Jensen, Alp Toker, Anders Carlsson, Andrew Wellington, Antti
|
||||
Koivisto, Apple Inc., Arthur Langereis, Baron Schwartz, Bjoern Graf,
|
||||
Brent Fulgham, Cameron Zwarich, Charles Samuels, Christian Dywan,
|
||||
Collabora Ltd., Cyrus Patel, Daniel Molkentin, Dave Maclachlan, David
|
||||
Smith, Dawit Alemayehu, Dirk Mueller, Dirk Schulze, Don Gibson, Enrico
|
||||
Ros, Eric Seidel, Frederik Holljen, Frerich Raabe, Friedmann Kleint,
|
||||
George Staikos, Google Inc., Graham Dennis, Harri Porten, Henry Mason,
|
||||
Hiroyuki Ikezoe, Holger Hans Peter Freyther, IBM, James G. Speth, Jan
|
||||
Alonzo, Jean-Loup Gailly, John Reis, Jonas Witt, Jon Shier, Jonas
|
||||
Witt, Julien Chaffraix, Justin Haygood, Kevin Ollivier, Kevin Watters,
|
||||
Kimmo Kinnunen, Kouhei Sutou, Krzysztof Kowalczyk, Lars Knoll, Luca
|
||||
Bruno, Maks Orlovich, Malte Starostik, Mark Adler, Martin Jones,
|
||||
Marvin Decker, Matt Lilek, Michael Emmel, Mitz Pettel, mozilla.org,
|
||||
Netscape Communications Corporation, Nicholas Shanks, Nikolas
|
||||
Zimmermann, Nokia, Oliver Hunt, Opened Hand, Paul Johnston, Peter
|
||||
Kelly, Pioneer Research Center USA, Rich Moore, Rob Buis, Robin Dunn,
|
||||
Ronald Tschalär, Samuel Weinig, Simon Hausmann, Staikos Computing
|
||||
Services Inc., Stefan Schimanski, Symantec Corporation, The Dojo
|
||||
Foundation, The Karbon Developers, Thomas Boyer, Tim Copperfield,
|
||||
Tobias Anton, Torben Weis, Trolltech, University of Cambridge, Vaclav
|
||||
Slavik, Waldo Bastian, Xan Lopez, Zack Rusin
|
||||
|
||||
The terms and conditions vary from file to file, but are one of:
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the
|
||||
distribution.
|
||||
|
||||
*OR*
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the
|
||||
distribution.
|
||||
3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
|
||||
its contributors may be used to endorse or promote products derived
|
||||
from this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
||||
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
||||
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
|
||||
|
||||
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1991 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the library GPL. It is
|
||||
numbered 2 because it goes with version 2 of the ordinary GPL.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Library General Public License, applies to some
|
||||
specially designated Free Software Foundation software, and to any
|
||||
other libraries whose authors decide to use it. You can use it for
|
||||
your libraries, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if
|
||||
you distribute copies of the library, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link a program with the library, you must provide
|
||||
complete object files to the recipients so that they can relink them
|
||||
with the library, after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
Our method of protecting your rights has two steps: (1) copyright
|
||||
the library, and (2) offer you this license which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
Also, for each distributor's protection, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
library. If the library is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original
|
||||
version, so that any problems introduced by others will not reflect on
|
||||
the original authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that companies distributing free
|
||||
software will individually obtain patent licenses, thus in effect
|
||||
transforming the program into proprietary software. To prevent this,
|
||||
we have made it clear that any patent must be licensed for everyone's
|
||||
free use or not licensed at all.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the ordinary
|
||||
GNU General Public License, which was designed for utility programs. This
|
||||
license, the GNU Library General Public License, applies to certain
|
||||
designated libraries. This license is quite different from the ordinary
|
||||
one; be sure to read it in full, and don't assume that anything in it is
|
||||
the same as in the ordinary license.
|
||||
|
||||
The reason we have a separate public license for some libraries is that
|
||||
they blur the distinction we usually make between modifying or adding to a
|
||||
program and simply using it. Linking a program with a library, without
|
||||
changing the library, is in some sense simply using the library, and is
|
||||
analogous to running a utility program or application program. However, in
|
||||
a textual and legal sense, the linked executable is a combined work, a
|
||||
derivative of the original library, and the ordinary General Public License
|
||||
treats it as such.
|
||||
|
||||
Because of this blurred distinction, using the ordinary General
|
||||
Public License for libraries did not effectively promote software
|
||||
sharing, because most developers did not use the libraries. We
|
||||
concluded that weaker conditions might promote sharing better.
|
||||
|
||||
However, unrestricted linking of non-free programs would deprive the
|
||||
users of those programs of all benefit from the free status of the
|
||||
libraries themselves. This Library General Public License is intended to
|
||||
permit developers of non-free programs to use free libraries, while
|
||||
preserving your freedom as a user of such programs to change the free
|
||||
libraries that are incorporated in them. (We have not seen how to achieve
|
||||
this as regards changes in header files, but we have achieved it as regards
|
||||
changes in the actual functions of the Library.) The hope is that this
|
||||
will lead to faster development of free libraries.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, while the latter only
|
||||
works together with the library.
|
||||
|
||||
Note that it is possible for a library to be covered by the ordinary
|
||||
General Public License rather than by this special one.
|
||||
|
||||
GNU LIBRARY GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library which
|
||||
contains a notice placed by the copyright holder or other authorized
|
||||
party saying it may be distributed under the terms of this Library
|
||||
General Public License (also called "this License"). Each licensee is
|
||||
addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also compile or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
c) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
d) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the source code distributed need not include anything that is normally
|
||||
distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Library General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 2.1, February 1999
|
||||
|
||||
Copyright (C) 1991, 1999 Free Software Foundation, Inc.
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
[This is the first released version of the Lesser GPL. It also counts
|
||||
as the successor of the GNU Library Public License, version 2, hence
|
||||
the version number 2.1.]
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
Licenses are intended to guarantee your freedom to share and change
|
||||
free software--to make sure the software is free for all its users.
|
||||
|
||||
This license, the Lesser General Public License, applies to some
|
||||
specially designated software packages--typically libraries--of the
|
||||
Free Software Foundation and other authors who decide to use it. You
|
||||
can use it too, but we suggest you first think carefully about whether
|
||||
this license or the ordinary General Public License is the better
|
||||
strategy to use in any particular case, based on the explanations below.
|
||||
|
||||
When we speak of free software, we are referring to freedom of use,
|
||||
not price. Our General Public Licenses are designed to make sure that
|
||||
you have the freedom to distribute copies of free software (and charge
|
||||
for this service if you wish); that you receive source code or can get
|
||||
it if you want it; that you can change the software and use pieces of
|
||||
it in new free programs; and that you are informed that you can do
|
||||
these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
distributors to deny you these rights or to ask you to surrender these
|
||||
rights. These restrictions translate to certain responsibilities for
|
||||
you if you distribute copies of the library or if you modify it.
|
||||
|
||||
For example, if you distribute copies of the library, whether gratis
|
||||
or for a fee, you must give the recipients all the rights that we gave
|
||||
you. You must make sure that they, too, receive or can get the source
|
||||
code. If you link other code with the library, you must provide
|
||||
complete object files to the recipients, so that they can relink them
|
||||
with the library after making changes to the library and recompiling
|
||||
it. And you must show them these terms so they know their rights.
|
||||
|
||||
We protect your rights with a two-step method: (1) we copyright the
|
||||
library, and (2) we offer you this license, which gives you legal
|
||||
permission to copy, distribute and/or modify the library.
|
||||
|
||||
To protect each distributor, we want to make it very clear that
|
||||
there is no warranty for the free library. Also, if the library is
|
||||
modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
restrictive license from a patent holder. Therefore, we insist that
|
||||
any patent license obtained for a version of the library must be
|
||||
consistent with the full freedom of use specified in this license.
|
||||
|
||||
Most GNU software, including some libraries, is covered by the
|
||||
ordinary GNU General Public License. This license, the GNU Lesser
|
||||
General Public License, applies to certain designated libraries, and
|
||||
is quite different from the ordinary General Public License. We use
|
||||
this license for certain libraries in order to permit linking those
|
||||
libraries into non-free programs.
|
||||
|
||||
When a program is linked with a library, whether statically or using
|
||||
a shared library, the combination of the two is legally speaking a
|
||||
combined work, a derivative of the original library. The ordinary
|
||||
General Public License therefore permits such linking only if the
|
||||
entire combination fits its criteria of freedom. The Lesser General
|
||||
Public License permits more lax criteria for linking other code with
|
||||
the library.
|
||||
|
||||
We call this license the "Lesser" General Public License because it
|
||||
does Less to protect the user's freedom than the ordinary General
|
||||
Public License. It also provides other free software developers Less
|
||||
of an advantage over competing non-free programs. These disadvantages
|
||||
are the reason we use the ordinary General Public License for many
|
||||
libraries. However, the Lesser license provides advantages in certain
|
||||
special circumstances.
|
||||
|
||||
For example, on rare occasions, there may be a special need to
|
||||
encourage the widest possible use of a certain library, so that it becomes
|
||||
a de-facto standard. To achieve this, non-free programs must be
|
||||
allowed to use the library. A more frequent case is that a free
|
||||
library does the same job as widely used non-free libraries. In this
|
||||
case, there is little to gain by limiting the free library to free
|
||||
software only, so we use the Lesser General Public License.
|
||||
|
||||
In other cases, permission to use a particular library in non-free
|
||||
programs enables a greater number of people to use a large body of
|
||||
free software. For example, permission to use the GNU C Library in
|
||||
non-free programs enables many more people to use the whole GNU
|
||||
operating system, as well as its variant, the GNU/Linux operating
|
||||
system.
|
||||
|
||||
Although the Lesser General Public License is Less protective of the
|
||||
users' freedom, it does ensure that the user of a program that is
|
||||
linked with the Library has the freedom and the wherewithal to run
|
||||
that program using a modified version of the Library.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License Agreement applies to any software library or other
|
||||
program which contains a notice placed by the copyright holder or
|
||||
other authorized party saying it may be distributed under the terms of
|
||||
this Lesser General Public License (also called "this License").
|
||||
Each licensee is addressed as "you".
|
||||
|
||||
A "library" means a collection of software functions and/or data
|
||||
prepared so as to be conveniently linked with application programs
|
||||
(which use some of those functions and data) to form executables.
|
||||
|
||||
The "Library", below, refers to any such software library or work
|
||||
which has been distributed under these terms. A "work based on the
|
||||
Library" means either the Library or any derivative work under
|
||||
copyright law: that is to say, a work containing the Library or a
|
||||
portion of it, either verbatim or with modifications and/or translated
|
||||
straightforwardly into another language. (Hereinafter, translation is
|
||||
included without limitation in the term "modification".)
|
||||
|
||||
"Source code" for a work means the preferred form of the work for
|
||||
making modifications to it. For a library, complete source code means
|
||||
all the source code for all modules it contains, plus any associated
|
||||
interface definition files, plus the scripts used to control compilation
|
||||
and installation of the library.
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running a program using the Library is not restricted, and output from
|
||||
such a program is covered only if its contents constitute a work based
|
||||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
appropriate copyright notice and disclaimer of warranty; keep intact
|
||||
all the notices that refer to this License and to the absence of any
|
||||
warranty; and distribute a copy of this License along with the
|
||||
Library.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) The modified work must itself be a software library.
|
||||
|
||||
b) You must cause the files modified to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
c) You must cause the whole of the work to be licensed at no
|
||||
charge to all third parties under the terms of this License.
|
||||
|
||||
d) If a facility in the modified Library refers to a function or a
|
||||
table of data to be supplied by an application program that uses
|
||||
the facility, other than as an argument passed when the facility
|
||||
is invoked, then you must make a good faith effort to ensure that,
|
||||
in the event an application does not supply such function or
|
||||
table, the facility still operates, and performs whatever part of
|
||||
its purpose remains meaningful.
|
||||
|
||||
(For example, a function in a library to compute square roots has
|
||||
a purpose that is entirely well-defined independent of the
|
||||
application. Therefore, Subsection 2d requires that any
|
||||
application-supplied function or table used by this function must
|
||||
be optional: if the application does not supply it, the square
|
||||
root function must still compute square roots.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Library,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Library, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote
|
||||
it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Library.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Library
|
||||
with the Library (or with a work based on the Library) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may opt to apply the terms of the ordinary GNU General Public
|
||||
License instead of this License to a given copy of the Library. To do
|
||||
this, you must alter all the notices that refer to this License, so
|
||||
that they refer to the ordinary GNU General Public License, version 2,
|
||||
instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
||||
This option is useful when you wish to copy part of the code of
|
||||
the Library into a program that is not a library.
|
||||
|
||||
4. You may copy and distribute the Library (or a portion or
|
||||
derivative of it, under Section 2) in object code or executable form
|
||||
under the terms of Sections 1 and 2 above provided that you accompany
|
||||
it with the complete corresponding machine-readable source code, which
|
||||
must be distributed under the terms of Sections 1 and 2 above on a
|
||||
medium customarily used for software interchange.
|
||||
|
||||
If distribution of object code is made by offering access to copy
|
||||
from a designated place, then offering equivalent access to copy the
|
||||
source code from the same place satisfies the requirement to
|
||||
distribute the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
5. A program that contains no derivative of any portion of the
|
||||
Library, but is designed to work with the Library by being compiled or
|
||||
linked with it, is called a "work that uses the Library". Such a
|
||||
work, in isolation, is not a derivative work of the Library, and
|
||||
therefore falls outside the scope of this License.
|
||||
|
||||
However, linking a "work that uses the Library" with the Library
|
||||
creates an executable that is a derivative of the Library (because it
|
||||
contains portions of the Library), rather than a "work that uses the
|
||||
library". The executable is therefore covered by this License.
|
||||
Section 6 states terms for distribution of such executables.
|
||||
|
||||
When a "work that uses the Library" uses material from a header file
|
||||
that is part of the Library, the object code for the work may be a
|
||||
derivative work of the Library even though the source code is not.
|
||||
Whether this is true is especially significant if the work can be
|
||||
linked without the Library, or if the work is itself a library. The
|
||||
threshold for this to be true is not precisely defined by law.
|
||||
|
||||
If such an object file uses only numerical parameters, data
|
||||
structure layouts and accessors, and small macros and small inline
|
||||
functions (ten lines or less in length), then the use of the object
|
||||
file is unrestricted, regardless of whether it is legally a derivative
|
||||
work. (Executables containing this object code plus portions of the
|
||||
Library will still fall under Section 6.)
|
||||
|
||||
Otherwise, if the work is a derivative of the Library, you may
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
under terms of your choice, provided that the terms permit
|
||||
modification of the work for the customer's own use and reverse
|
||||
engineering for debugging such modifications.
|
||||
|
||||
You must give prominent notice with each copy of the work that the
|
||||
Library is used in it and that the Library and its use are covered by
|
||||
this License. You must supply a copy of this License. If the work
|
||||
during execution displays copyright notices, you must include the
|
||||
copyright notice for the Library among them, as well as a reference
|
||||
directing the user to the copy of this License. Also, you must do one
|
||||
of these things:
|
||||
|
||||
a) Accompany the work with the complete corresponding
|
||||
machine-readable source code for the Library including whatever
|
||||
changes were used in the work (which must be distributed under
|
||||
Sections 1 and 2 above); and, if the work is an executable linked
|
||||
with the Library, with the complete machine-readable "work that
|
||||
uses the Library", as object code and/or source code, so that the
|
||||
user can modify the Library and then relink to produce a modified
|
||||
executable containing the modified Library. (It is understood
|
||||
that the user who changes the contents of definitions files in the
|
||||
Library will not necessarily be able to recompile the application
|
||||
to use the modified definitions.)
|
||||
|
||||
b) Use a suitable shared library mechanism for linking with the
|
||||
Library. A suitable mechanism is one that (1) uses at run time a
|
||||
copy of the library already present on the user's computer system,
|
||||
rather than copying library functions into the executable, and (2)
|
||||
will operate properly with a modified version of the library, if
|
||||
the user installs one, as long as the modified version is
|
||||
interface-compatible with the version that the work was made with.
|
||||
|
||||
c) Accompany the work with a written offer, valid for at
|
||||
least three years, to give the same user the materials
|
||||
specified in Subsection 6a, above, for a charge no more
|
||||
than the cost of performing this distribution.
|
||||
|
||||
d) If distribution of the work is made by offering access to copy
|
||||
from a designated place, offer equivalent access to copy the above
|
||||
specified materials from the same place.
|
||||
|
||||
e) Verify that the user has already received a copy of these
|
||||
materials or that you have already sent this user a copy.
|
||||
|
||||
For an executable, the required form of the "work that uses the
|
||||
Library" must include any data and utility programs needed for
|
||||
reproducing the executable from it. However, as a special exception,
|
||||
the materials to be distributed need not include anything that is
|
||||
normally distributed (in either source or binary form) with the major
|
||||
components (compiler, kernel, and so on) of the operating system on
|
||||
which the executable runs, unless that component itself accompanies
|
||||
the executable.
|
||||
|
||||
It may happen that this requirement contradicts the license
|
||||
restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
library, provided that the separate distribution of the work based on
|
||||
the Library and of the other library facilities is otherwise
|
||||
permitted, and provided that you do these two things:
|
||||
|
||||
a) Accompany the combined library with a copy of the same work
|
||||
based on the Library, uncombined with any other library
|
||||
facilities. This must be distributed under the terms of the
|
||||
Sections above.
|
||||
|
||||
b) Give prominent notice with the combined library of the fact
|
||||
that part of it is a work based on the Library, and explaining
|
||||
where to find the accompanying uncombined form of the same work.
|
||||
|
||||
8. You may not copy, modify, sublicense, link with, or distribute
|
||||
the Library except as expressly provided under this License. Any
|
||||
attempt otherwise to copy, modify, sublicense, link with, or
|
||||
distribute the Library is void, and will automatically terminate your
|
||||
rights under this License. However, parties who have received copies,
|
||||
or rights, from you under this License will not have their licenses
|
||||
terminated so long as such parties remain in full compliance.
|
||||
|
||||
9. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Library or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Library (or any work based on the
|
||||
Library), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Library or works based on it.
|
||||
|
||||
10. Each time you redistribute the Library (or any work based on the
|
||||
Library), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute, link with or modify the Library
|
||||
subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Library at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Library by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Library.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under any
|
||||
particular circumstance, the balance of the section is intended to apply,
|
||||
and the section as a whole is intended to apply in other circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
12. If the distribution and/or use of the Library is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Library under this License may add
|
||||
an explicit geographical distribution limitation excluding those countries,
|
||||
so that distribution is permitted only in or among countries not thus
|
||||
excluded. In such case, this License incorporates the limitation as if
|
||||
written in the body of this License.
|
||||
|
||||
13. The Free Software Foundation may publish revised and/or new
|
||||
versions of the Lesser General Public License from time to time.
|
||||
Such new versions will be similar in spirit to the present version,
|
||||
but may differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Library
|
||||
specifies a version number of this License which applies to it and
|
||||
"any later version", you have the option of following the terms and
|
||||
conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
copyrighted by the Free Software Foundation, write to the Free
|
||||
Software Foundation; we sometimes make exceptions for this. Our
|
||||
decision will be guided by the two goals of preserving the free status
|
||||
of all derivatives of our free software and of promoting the sharing
|
||||
and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
|
||||
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
|
||||
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
|
||||
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
|
||||
LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
|
||||
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
|
||||
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
|
||||
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
|
||||
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
|
||||
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
|
||||
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
|
||||
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
|
||||
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
|
||||
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
6
tests/blink_perf_tests/README.md
Normal file
6
tests/blink_perf_tests/README.md
Normal file
|
@ -0,0 +1,6 @@
|
|||
# Blink perf tests
|
||||
|
||||
A vendored copy of the [blink perf tests].
|
||||
This allows us to easily compare performance
|
||||
|
||||
[blink perf tests]: https://chromium.googlesource.com/chromium/src/+/HEAD/third_party/blink/perf_tests/
|
9
tests/blink_perf_tests/filters.txt
Normal file
9
tests/blink_perf_tests/filters.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Duplicate / Other upstream source
|
||||
- /MotionMark
|
||||
- /speedometer21
|
||||
|
||||
# Servo does not support accessibility yet.
|
||||
- /accessibility
|
||||
|
||||
# Include the rest.
|
||||
+ /*
|
22
tests/blink_perf_tests/get_perf_tests.sh
Normal file
22
tests/blink_perf_tests/get_perf_tests.sh
Normal file
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
|
||||
# script to vendor blink perf tests into servo.
|
||||
# At the time of writing we are mainly interested in the layout tests.
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
CHROMIUM_TAG=141.0.7354.1
|
||||
curl -LO https://chromium.googlesource.com/chromium/src/+archive/refs/tags/${CHROMIUM_TAG}/third_party/blink/perf_tests.tar.gz
|
||||
# Delete any old directory contents.
|
||||
rm -rf perf_tests && mkdir perf_tests
|
||||
tar -xf perf_tests.tar.gz -C perf_tests
|
||||
# Download license
|
||||
curl -L https://chromium.googlesource.com/chromium/src/+/refs/tags/141.0.7354.1/third_party/blink/LICENSE_FOR_ABOUT_CREDITS?format=TEXT \
|
||||
| base64 -d > LICENSE_FOR_ABOUT_CREDITS
|
||||
git add LICENSE_FOR_ABOUT_CREDITS
|
1
tests/blink_perf_tests/patches/.gitkeep
Normal file
1
tests/blink_perf_tests/patches/.gitkeep
Normal file
|
@ -0,0 +1 @@
|
|||
# Keep this directory, so that we can easily patch if necessary
|
4
tests/blink_perf_tests/perf_tests/DIR_METADATA
Normal file
4
tests/blink_perf_tests/perf_tests/DIR_METADATA
Normal file
|
@ -0,0 +1,4 @@
|
|||
monorail {
|
||||
component: "Speed>Benchmark"
|
||||
}
|
||||
team_email: "benchmarking-dev@chromium.org"
|
3
tests/blink_perf_tests/perf_tests/OWNERS
Normal file
3
tests/blink_perf_tests/perf_tests/OWNERS
Normal file
|
@ -0,0 +1,3 @@
|
|||
haraken@chromium.org
|
||||
ikilpatrick@chromium.org
|
||||
kojii@chromium.org
|
1
tests/blink_perf_tests/perf_tests/README.md
Normal file
1
tests/blink_perf_tests/perf_tests/README.md
Normal file
|
@ -0,0 +1 @@
|
|||
Please refer to [blink_perf guide](../../../docs/speed/benchmark/harnesses/blink_perf.md).
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var longStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ ";
|
||||
for (var i = 0; i < 15; i++)
|
||||
longStr = longStr + longStr;
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers `atob` where the input has whitespace.",
|
||||
setup: function() {},
|
||||
run: function() {
|
||||
atob(longStr);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
20
tests/blink_perf_tests/perf_tests/base64/atob.html
Normal file
20
tests/blink_perf_tests/perf_tests/base64/atob.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var longStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
for (var i = 0; i < 15; i++)
|
||||
longStr = longStr + longStr;
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers `atob`.",
|
||||
setup: function() {},
|
||||
run: function() {
|
||||
atob(longStr);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
21
tests/blink_perf_tests/perf_tests/base64/btoa.html
Normal file
21
tests/blink_perf_tests/perf_tests/base64/btoa.html
Normal file
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var longStr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
||||
for (var i = 0; i < 15; i++)
|
||||
longStr = longStr + longStr;
|
||||
var binary = atob(longStr);
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers `btoa`.",
|
||||
setup: function() {},
|
||||
run: function() {
|
||||
btoa(binary);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
22
tests/blink_perf_tests/perf_tests/bindings/append-child.html
Normal file
22
tests/blink_perf_tests/perf_tests/bindings/append-child.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
var childDiv = document.createElement("div");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'appendChild' and 'removeChild' in Dromaeo/dom-modify.html.",
|
||||
setup: function() {
|
||||
div.innerHTML = "";
|
||||
},
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
var localChildDiv = childDiv;
|
||||
for (var i = 0; i < 50000; i++)
|
||||
localDiv.appendChild(localChildDiv);
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'createElement', 'createTextNode' and 'cloneNode' in Dromaeo/dom-modify.html, and other DOM methods that return a new Node object.",
|
||||
run: function() {
|
||||
for (var i = 0; i < 5000; i++)
|
||||
document.createElement("div");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark repeatedly accesses document.implementation.",
|
||||
run: function() {
|
||||
for (var i = 0; i < 100000; ++i)
|
||||
document.implementation;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,34 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var elements = [];
|
||||
elements.push(document.createElement("div"));
|
||||
elements.push(document.createElement("a"));
|
||||
elements.push(document.createElement("br"));
|
||||
elements.push(document.createElement("form"));
|
||||
elements.push(document.createElement("canvas"));
|
||||
elements.push(document.createElement("img"));
|
||||
elements.push(document.createElement("details"));
|
||||
elements.push(document.createElement("font"));
|
||||
elements.push(document.createElement("span"));
|
||||
elements.push(document.createElement("table"));
|
||||
elements.push(document.createElement("tbody"));
|
||||
elements.push(document.createElement("th"));
|
||||
elements.push(document.createElement("tr"));
|
||||
elements.push(document.createElement("td"));
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "A benchmark to test performance when accessing a DOM attribute on a prototype chain of multipe types of elements. See https://crbug.com/43394 for more background.",
|
||||
run: function() {
|
||||
var localElements = elements;
|
||||
for (var i = 0; i < 10000; i++) {
|
||||
for (var j = 0; j < 14; j++) {
|
||||
elements[j].baseURI;
|
||||
}
|
||||
}
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
tests/blink_perf_tests/perf_tests/bindings/first-child.html
Normal file
18
tests/blink_perf_tests/perf_tests/bindings/first-child.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
div.appendChild(document.createElement("div"));
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'firstChild', 'lastChild', 'nextSibling' and 'previousSibling' in Dromaeo/dom-traverse.html, and other DOM attributes that return a Node object.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.firstChild;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
16
tests/blink_perf_tests/perf_tests/bindings/gc-forest.html
Normal file
16
tests/blink_perf_tests/perf_tests/bindings/gc-forest.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of creating one million divs without retaining references, then running the garbage collector.",
|
||||
run: function() {
|
||||
(function() {
|
||||
for (var i = 0; i < 1000000; i++)
|
||||
document.createElement("div");
|
||||
})();
|
||||
PerfTestRunner.gc();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
16
tests/blink_perf_tests/perf_tests/bindings/gc-mini-tree.html
Normal file
16
tests/blink_perf_tests/perf_tests/bindings/gc-mini-tree.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of creating a half million divs that contain spans without retaining references, then running the garbage collector.",
|
||||
run: function() {
|
||||
(function() {
|
||||
for (var i = 0; i < 500000; i++)
|
||||
document.createElement("div").appendChild(document.createElement("span"));
|
||||
})();
|
||||
PerfTestRunner.gc();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
17
tests/blink_perf_tests/perf_tests/bindings/gc-tree.html
Normal file
17
tests/blink_perf_tests/perf_tests/bindings/gc-tree.html
Normal file
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of creating one million divs inside a div, releasing references, then running the garbage collector.",
|
||||
run: function() {
|
||||
(function() {
|
||||
var root = document.createElement("div");
|
||||
for (var i = 0; i < 1000000; i++)
|
||||
root.appendChild(document.createElement("div"));
|
||||
})();
|
||||
PerfTestRunner.gc();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo" role="group"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'getAttribute' in Dromaeo/dom-attr.html, and other DOM methods that return a String.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.getAttribute("role");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'getAttribute' in Dromaeo/dom-attr.html, and other DOM methods that return a String.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.getAttribute("id");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'getElementById' in Dromaeo/dom-query.html, and other DOM methods that return a Node object.",
|
||||
run: function() {
|
||||
for (var i = 0; i < 100000; i++)
|
||||
document.getElementById("foo");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'getElementsByTagName (not in document)', 'getElementsByTagName', 'getElementsByName (not in document)' and 'getElementsByName' in Dromaeo/dom-query.html, and other DOM methods that return a NodeList.",
|
||||
run: function() {
|
||||
for (var i = 0; i < 50000; i++)
|
||||
document.getElementsByTagName("div");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
tests/blink_perf_tests/perf_tests/bindings/id-getter.html
Normal file
18
tests/blink_perf_tests/perf_tests/bindings/id-getter.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'element.property' in Dromaeo/dom-attr.html, 'innerHTML' in Dromaeo/dom-modify.html, and other DOM attributes that return a String.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.id;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
18
tests/blink_perf_tests/perf_tests/bindings/id-setter.html
Normal file
18
tests/blink_perf_tests/perf_tests/bindings/id-setter.html
Normal file
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'element.property = value' in Dromaeo/dom-attr.html, and other DOM attributes that sets a String.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 50000; i++)
|
||||
localDiv.id = "foo";
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
document.body.appendChild(document.createElement("div"));
|
||||
}
|
||||
var divs = document.getElementsByTagName("div");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark measures performance of indexed property getters.",
|
||||
run: function() {
|
||||
var localDivs = divs;
|
||||
for (var i = 0; i < 1000; i++)
|
||||
localDivs[i];
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,24 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
var childDiv = document.createElement("div");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'insertBefore' in Dromaeo/dom-modify.html and replaceChild()",
|
||||
setup: function() {
|
||||
div.innerHTML = "";
|
||||
div.appendChild(childDiv);
|
||||
},
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
var localFirstChildOfDiv = div.firstChild;
|
||||
var localChildDiv = childDiv;
|
||||
for (var i = 0; i < 50000; i++)
|
||||
localDiv.insertBefore(localChildDiv, localFirstChildOfDiv);
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
for (var i = 0; i < 1000; i++) {
|
||||
var key = "key_" + i;
|
||||
var value = "value_" + i;
|
||||
div.dataset[key] = value;
|
||||
}
|
||||
function assertEquals(a, b) {
|
||||
if (a !== b) console.log("assertion failed: not equal", a, b);
|
||||
}
|
||||
var i = 0;
|
||||
for (var key in div.dataset) {
|
||||
var ref_key = "key_" + i;
|
||||
var ref_value = "value_" + i;
|
||||
assertEquals(key, ref_key);
|
||||
assertEquals(div.dataset[key], ref_value);
|
||||
i++;
|
||||
}
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers enumerator of named properties",
|
||||
run: function() {
|
||||
for (var key in div.dataset);
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,20 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
for (var i = 0; i < 100000; i++)
|
||||
div.appendChild(document.createElement("div"));
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'childNodes' in Dromaeo/dom-traverse.html, and other DOM attributes that access NodeList.",
|
||||
run: function() {
|
||||
var childNodes = div.childNodes;
|
||||
var length = div.childNodes.length;
|
||||
for (var i = 0; i < length; i++)
|
||||
childNodes[i];
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
15
tests/blink_perf_tests/perf_tests/bindings/node-type.html
Normal file
15
tests/blink_perf_tests/perf_tests/bindings/node-type.html
Normal file
|
@ -0,0 +1,15 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers DOM attributes that return integers.",
|
||||
run: function() {
|
||||
var localBody = document.body;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localBody.nodeType;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
39
tests/blink_perf_tests/perf_tests/bindings/post-message.html
Normal file
39
tests/blink_perf_tests/perf_tests/bindings/post-message.html
Normal file
|
@ -0,0 +1,39 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var isDone = false;
|
||||
|
||||
function runTest() {
|
||||
var numRound = 1000;
|
||||
var worker = new Worker('resources/worker.js');
|
||||
|
||||
var startTime = PerfTestRunner.now();
|
||||
worker.onmessage = function(event) {
|
||||
numRound--;
|
||||
if (numRound > 0) {
|
||||
worker.postMessage('next');
|
||||
} else {
|
||||
PerfTestRunner.measureValueAsync(PerfTestRunner.now() - startTime);
|
||||
if (!isDone)
|
||||
runTest();
|
||||
}
|
||||
};
|
||||
worker.postMessage('start');
|
||||
}
|
||||
|
||||
function testDone() {
|
||||
isDone = true;
|
||||
}
|
||||
|
||||
window.onload = function () {
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: "Measures time to run 1000 postMessage round trips in serial.",
|
||||
unit: 'ms',
|
||||
run: runTest,
|
||||
done: testDone,
|
||||
});
|
||||
};
|
||||
</script>
|
||||
<div id="log"></div>
|
||||
</body>
|
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
{"type":3,"mutations":[{"target":{"_index_":18,"transferred":1},"addedNodes":null,"removedNodes":null,"previousSibling":null,"nextSibling":null,"attributeName":"class","attributeNamespace":null,"oldValue":"candidateTable_victor","type":0,"propertyName":null,"value":"candidateTable_victor candidateTable_displayVictor","addedEvents":null,"removedEvents":null,"measure":null},{"target":{"_index_":35,"transferred":1},"addedNodes":null,"removedNodes":null,"previousSibling":null,"nextSibling":null,"attributeName":"class","attributeNamespace":null,"oldValue":"candidateTable_victor candidateTable_displayVictor","type":0,"propertyName":null,"value":"candidateTable_victor","addedEvents":null,"removedEvents":null,"measure":null},{"target":{"_index_":74,"transferred":1},"addedNodes":null,"removedNodes":null,"previousSibling":null,"nextSibling":null,"attributeName":"fill","attributeNamespace":null,"oldValue":"black","type":0,"propertyName":null,"value":"red","addedEvents":null,"removedEvents":null,"measure":null},{"target":{"_index_":76,"transferred":1},"addedNodes":null,"removedNodes":null,"previousSibling":null,"nextSibling":null,"attributeName":null,"attributeNamespace":null,"oldValue":"Region winner Steven Armstrong","type":1,"propertyName":null,"value":"Region winner ","addedEvents":null,"removedEvents":null,"measure":null},{"target":{"_index_":75,"transferred":1},"addedNodes":null,"removedNodes":null,"previousSibling":null,"nextSibling":null,"attributeName":"class","attributeNamespace":null,"oldValue":"candidateMap_tooltip candidateMap_showTooltip","type":0,"propertyName":null,"value":"candidateMap_tooltip","addedEvents":null,"removedEvents":null,"measure":null}]}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,47 @@
|
|||
const StructuredClonePerfTestRunner = (function() {
|
||||
function pingPong(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let beginSerialize, endSerialize, beginDeserialize, endDeserialize;
|
||||
window.addEventListener('message', function listener(e) {
|
||||
try {
|
||||
e.data; // Force deserialization.
|
||||
endDeserialize = PerfTestRunner.now();
|
||||
window.removeEventListener('message', listener);
|
||||
resolve([endSerialize - beginSerialize, endDeserialize - beginDeserialize]);
|
||||
} catch (err) { reject(err); }
|
||||
});
|
||||
|
||||
beginSerialize = PerfTestRunner.now();
|
||||
window.postMessage(data, '*');
|
||||
beginDeserialize = endSerialize = PerfTestRunner.now();
|
||||
// While Chrome does the deserialize lazily when e.data is read, this
|
||||
// isn't portable, so it's more fair to measure from when the message is
|
||||
// posted.
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
measureTimeAsync(test) {
|
||||
let isDone = false;
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: test.description,
|
||||
unit: 'ms',
|
||||
warmUpCount: test.warmUpCount || 10,
|
||||
iterationCount: test.iterationCount || 250,
|
||||
done() { isDone = true; },
|
||||
run: pingPongUntilDone,
|
||||
});
|
||||
|
||||
function pingPongUntilDone() {
|
||||
pingPong(test.data).then(([serializeTime, deserializeTime]) => {
|
||||
console.log([serializeTime, deserializeTime]);
|
||||
if (test.measure === 'serialize')
|
||||
PerfTestRunner.measureValueAsync(serializeTime);
|
||||
else if (test.measure === 'deserialize')
|
||||
PerfTestRunner.measureValueAsync(deserializeTime);
|
||||
if (!isDone) pingPongUntilDone();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
})();
|
Binary file not shown.
|
@ -0,0 +1,45 @@
|
|||
(module
|
||||
(type $0 (func (param externref i32)))
|
||||
(import "../clearCalls.js" "clearThruJS" (func $assembly/index/clearThruJS (param externref i32)))
|
||||
(import "../clearCalls.js" "clearNoJS" (func $assembly/index/clearNoJS (param externref i32)))
|
||||
(memory $0 0)
|
||||
(export "clearManyTimesThruJS" (func $assembly/index/clearManyTimesThruJS))
|
||||
(export "clearManyTimesNoJS" (func $assembly/index/clearManyTimesNoJS))
|
||||
(export "memory" (memory $0))
|
||||
(func $assembly/index/clearManyTimesThruJS (param $0 externref) (param $1 i32)
|
||||
(local $2 i32)
|
||||
loop $for-loop|0
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.gt_s
|
||||
if
|
||||
local.get $0
|
||||
i32.const 16384
|
||||
call $assembly/index/clearThruJS
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $2
|
||||
br $for-loop|0
|
||||
end
|
||||
end
|
||||
)
|
||||
(func $assembly/index/clearManyTimesNoJS (param $0 externref) (param $1 i32)
|
||||
(local $2 i32)
|
||||
loop $for-loop|0
|
||||
local.get $1
|
||||
local.get $2
|
||||
i32.gt_s
|
||||
if
|
||||
local.get $0
|
||||
i32.const 16384
|
||||
call $assembly/index/clearNoJS
|
||||
local.get $2
|
||||
i32.const 1
|
||||
i32.add
|
||||
local.set $2
|
||||
br $for-loop|0
|
||||
end
|
||||
end
|
||||
)
|
||||
)
|
|
@ -0,0 +1,50 @@
|
|||
const WorkerStructuredCloneDifferentPayloadsPerfTestRunner = (function() {
|
||||
function pingPong(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let mainThreadBeginSerialize, mainThreadEndDeserialize, iteration, numMessages;
|
||||
iteration = 0;
|
||||
numMessages = data['toWorker'].length;
|
||||
worker.addEventListener('message', function listener(e) {
|
||||
try {
|
||||
e.data.sendData; // Force deserialization.
|
||||
// keep sending messages to worker until worker runs out of responses.
|
||||
if (!e.data.done && iteration < numMessages) {
|
||||
iteration++;
|
||||
worker.postMessage({'data' : data['toWorker'][iteration], 'iteration' : iteration});
|
||||
} else {
|
||||
mainThreadEndDeserialize = performance.now();
|
||||
worker.removeEventListener('message', listener);
|
||||
totalTime = mainThreadEndDeserialize - mainThreadBeginSerialize;
|
||||
resolve([totalTime]);
|
||||
}
|
||||
} catch (err) { reject(err); }
|
||||
});
|
||||
mainThreadBeginSerialize = performance.now();
|
||||
worker.postMessage({'data' : data['toWorker'][iteration], 'iteration' : iteration});
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
measureTimeAsync(test) {
|
||||
let isDone = false;
|
||||
worker = new Worker('resources/worker-structured-clone-different-payloads.js');
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: test.description,
|
||||
unit: 'ms',
|
||||
warmUpCount: test.warmUpCount || 5,
|
||||
iterationCount: test.iterationCount || 15,
|
||||
done() { isDone = true; },
|
||||
run: pingPongUntilDone,
|
||||
});
|
||||
|
||||
function pingPongUntilDone() {
|
||||
pingPong(test.data).then(([totalTime]) => {
|
||||
console.log([totalTime]);
|
||||
if (test.measure == 'roundtrip')
|
||||
PerfTestRunner.measureValueAsync(totalTime);
|
||||
if (!isDone) pingPongUntilDone();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,15 @@
|
|||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("GET", "data/preact-from-worker.json", false);
|
||||
xhr.send(null);
|
||||
var sendData = JSON.parse(xhr.responseText)
|
||||
var length = sendData['fromWorker'].length;
|
||||
|
||||
self.onmessage = function(e) {
|
||||
var data = e.data; // Force deserialization.
|
||||
var iteration = e.data.iteration;
|
||||
var done = false;
|
||||
if (iteration == length - 1){
|
||||
done = true;
|
||||
}
|
||||
self.postMessage({'sendData' : sendData['fromWorker'][iteration], 'done': done});
|
||||
};
|
|
@ -0,0 +1,51 @@
|
|||
const WorkerStructuredClonePerfTestRunner = (function() {
|
||||
function pingPong(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let mainThreadBeginSerialize, mainThreadEndDeserialize, toWorkerTime, fromWorkerTime, totalTime;
|
||||
worker.addEventListener('message', function listener(e) {
|
||||
try {
|
||||
e.data; // Force deserialization.
|
||||
mainThreadEndDeserialize = performance.now();
|
||||
worker.removeEventListener('message', listener);
|
||||
// toWorkerTime: Time from main thread beginning serialize to end of worker deserialize
|
||||
toWorkerTime = (e.data.workerDeserialize + (e.data.workerTimeOrigin - performance.timeOrigin)) - mainThreadBeginSerialize;
|
||||
// fromWorkerTime: Time from worker beginning serialize to end of main thread deserialize
|
||||
fromWorkerTime = mainThreadEndDeserialize - (e.data.workerDeserialize + (e.data.workerTimeOrigin - performance.timeOrigin));
|
||||
// totalTime: Time from main thread beginning serialzie to end of main thread deserialize
|
||||
totalTime = mainThreadEndDeserialize - mainThreadBeginSerialize
|
||||
resolve([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
} catch (err) { reject(err); }
|
||||
});
|
||||
mainThreadBeginSerialize = performance.now();
|
||||
worker.postMessage(data);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
measureTimeAsync(test) {
|
||||
let isDone = false;
|
||||
worker = new Worker('resources/worker-structured-clone.js');
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: test.description,
|
||||
unit: 'ms',
|
||||
warmUpCount: test.warmUpCount || 10,
|
||||
iterationCount: test.iterationCount || 250,
|
||||
done() { isDone = true; },
|
||||
run: pingPongUntilDone,
|
||||
});
|
||||
|
||||
function pingPongUntilDone() {
|
||||
pingPong(test.data).then(([toWorkerTime, fromWorkerTime, totalTime]) => {
|
||||
console.log([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
if (test.measure == 'toWorker')
|
||||
PerfTestRunner.measureValueAsync(toWorkerTime);
|
||||
else if (test.measure === 'fromWorker')
|
||||
PerfTestRunner.measureValueAsync(fromWorkerTime);
|
||||
else if (test.measure == 'roundtrip')
|
||||
PerfTestRunner.measureValueAsync(totalTime);
|
||||
if (!isDone) pingPongUntilDone();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,7 @@
|
|||
self.onmessage = function(e) {
|
||||
var data = e.data; // Force deserialization
|
||||
var workerDeserialize = performance.now();
|
||||
self.postMessage({'recieveddData' : data,
|
||||
'workerTimeOrigin' : performance.timeOrigin,
|
||||
'workerDeserialize' : workerDeserialize});
|
||||
};
|
|
@ -0,0 +1,54 @@
|
|||
const WorkerTextEncodedTransferablePerfTestRunner = (function() {
|
||||
function pingPong(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let sendData, textEncoder, textDecoder, mainThreadBeginEncode, mainThreadEndDecode, toWorkerTime, fromWorkerTime, totalTime;
|
||||
textEncoder = new TextEncoder('utf-8');
|
||||
textDecoder = new TextDecoder('utf-8');
|
||||
worker.addEventListener('message', function listener(e) {
|
||||
try {
|
||||
textDecoder.decode(e.data.data);
|
||||
mainThreadEndDecode = performance.now();
|
||||
worker.removeEventListener('message', listener);
|
||||
// toWorkerTime: time to encode the data, send it to the worker, and decode it on the worker
|
||||
toWorkerTime = (e.data.workerDecode + (e.data.workerTimeOrigin - performance.timeOrigin)) - mainThreadBeginEncode;
|
||||
// fromWorkerTime: time to encode the data on the worker, send it back to the main thread, and deocde it
|
||||
fromWorkerTime = mainThreadEndDecode - (e.data.workerDecode + (e.data.workerTimeOrigin - performance.timeOrigin));
|
||||
// totalTime: time to do the whole roundtrip
|
||||
totalTime = mainThreadEndDecode - mainThreadBeginEncode
|
||||
resolve([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
} catch (err) { reject(err); }
|
||||
});
|
||||
mainThreadBeginEncode = performance.now();
|
||||
sendData = textEncoder.encode(data).buffer;
|
||||
worker.postMessage({"data" : sendData}, [sendData]);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
measureTimeAsync(test) {
|
||||
let isDone = false;
|
||||
worker = new Worker('resources/worker-text-encoded-transferable.js');
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: test.description,
|
||||
unit: 'ms',
|
||||
warmUpCount: test.warmUpCount || 10,
|
||||
iterationCount: test.iterationCount || 250,
|
||||
done() { isDone = true; },
|
||||
run: pingPongUntilDone,
|
||||
});
|
||||
|
||||
function pingPongUntilDone() {
|
||||
pingPong(test.data).then(([toWorkerTime, fromWorkerTime, totalTime]) => {
|
||||
console.log([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
if (test.measure == 'toWorker')
|
||||
PerfTestRunner.measureValueAsync(toWorkerTime);
|
||||
else if (test.measure === 'fromWorker')
|
||||
PerfTestRunner.measureValueAsync(fromWorkerTime);
|
||||
else if (test.measure == 'roundtrip')
|
||||
PerfTestRunner.measureValueAsync(totalTime);
|
||||
if (!isDone) pingPongUntilDone();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,11 @@
|
|||
var textDecoder = new TextDecoder('utf-8');
|
||||
var textEncoder = new TextEncoder('utf-8');
|
||||
self.onmessage = function(e) {
|
||||
var data = textDecoder.decode(e.data.data);
|
||||
var workerDecode = performance.now();
|
||||
var sendData = textEncoder.encode(data).buffer;
|
||||
self.postMessage({'data' : sendData,
|
||||
'workerTimeOrigin' : performance.timeOrigin,
|
||||
'workerDecode' : workerDecode},
|
||||
[sendData]);
|
||||
};
|
|
@ -0,0 +1,52 @@
|
|||
const WorkerTransferablePerfTestRunner = (function() {
|
||||
function pingPong(data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
let sendData, mainThreadBeginTransfer, workerEndTransfer, toWorkerTime, fromWorkerTime, totalTime;
|
||||
worker.addEventListener('message', function listener(e) {
|
||||
try {
|
||||
e.data.data;
|
||||
workerEndTransfer = performance.now();
|
||||
worker.removeEventListener('message', listener);
|
||||
// toWorkerTime: Time for the main thread to transfer data to the worker
|
||||
toWorkerTime = (e.data.mainThreadEndTransfer + (e.data.workerTimeOrigin - performance.timeOrigin)) - mainThreadBeginTransfer;
|
||||
// fromWorkerTime: Time for the worker to transfer data back to the main thread
|
||||
fromWorkerTime = workerEndTransfer - (e.data.mainThreadEndTransfer + (e.data.workerTimeOrigin - performance.timeOrigin));
|
||||
// totalTime: Time from main thread beginning transfer to the end of the worker transfer
|
||||
totalTime = workerEndTransfer - mainThreadBeginTransfer
|
||||
resolve([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
} catch (err) { reject(err); }
|
||||
});
|
||||
sendData = data.slice(0); // Copy the data for every new transfer
|
||||
mainThreadBeginTransfer = performance.now();
|
||||
worker.postMessage({"data" : sendData}, [sendData]);
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
measureTimeAsync(test) {
|
||||
let isDone = false;
|
||||
worker = new Worker('resources/worker-transferable.js');
|
||||
PerfTestRunner.startMeasureValuesAsync({
|
||||
description: test.description,
|
||||
unit: 'ms',
|
||||
warmUpCount: test.warmUpCount || 10,
|
||||
iterationCount: test.iterationCount || 250,
|
||||
done() { isDone = true;},
|
||||
run: pingPongUntilDone,
|
||||
});
|
||||
|
||||
function pingPongUntilDone() {
|
||||
pingPong(test.data).then(([toWorkerTime, fromWorkerTime, totalTime]) => {
|
||||
console.log([toWorkerTime, fromWorkerTime, totalTime]);
|
||||
if (test.measure == 'toWorker')
|
||||
PerfTestRunner.measureValueAsync(toWorkerTime);
|
||||
else if (test.measure === 'fromWorker')
|
||||
PerfTestRunner.measureValueAsync(fromWorkerTime);
|
||||
else if (test.measure == 'roundtrip')
|
||||
PerfTestRunner.measureValueAsync(totalTime);
|
||||
if (!isDone) pingPongUntilDone();
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,8 @@
|
|||
self.onmessage = function(e) {
|
||||
var data = e.data.data;
|
||||
var mainThreadEndTransfer = performance.now();
|
||||
self.postMessage({'data' : data,
|
||||
'workerTimeOrigin' : performance.timeOrigin,
|
||||
'mainThreadEndTransfer' : mainThreadEndTransfer},
|
||||
[data]);
|
||||
};
|
|
@ -0,0 +1,3 @@
|
|||
self.onmessage = function(m) {
|
||||
self.postMessage('received');
|
||||
};
|
|
@ -0,0 +1,21 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
let dataArray = [];
|
||||
for (let i = 0; i < 100000; i++) {
|
||||
// We are interested in the conversion of JS arrays to C++ sequences, not in
|
||||
// the JS string to C++ string conversion, so just push empty strings into
|
||||
// the array.
|
||||
dataArray.push('');
|
||||
}
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark measures the overhead of converting JavaScript objects into WebIDL sequences (fast path for arrays)",
|
||||
run: function() {
|
||||
new Blob(dataArray);
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,30 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
let dataArray = [];
|
||||
for (let i = 0; i < 100000; i++)
|
||||
dataArray.push('');
|
||||
|
||||
let iterableData = {
|
||||
[Symbol.iterator]() {
|
||||
var count = 0;
|
||||
return {
|
||||
next() {
|
||||
if (count >= dataArray.length)
|
||||
return {done: true};
|
||||
return {done: false, value: dataArray[count++]};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark measures the overhead of converting JavaScript objects into WebIDL sequences (slow path using the @@iteratorprotocol)",
|
||||
run: function() {
|
||||
new Blob(iterableData);
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000000;
|
||||
var obj = [];
|
||||
for (var i = 0; i < length; i++)
|
||||
obj.push(undefined);
|
||||
var worker = new Worker('resources/worker.js');
|
||||
worker.onmessage = function(event) {
|
||||
console.log("received");
|
||||
};
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of serializing a long array containing 'undefined's.",
|
||||
run: function() {
|
||||
worker.postMessage(obj);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var log2Length = 23;
|
||||
var str = "a";
|
||||
for (var i = 0; i < log2Length; i++)
|
||||
str = str + str;
|
||||
var worker = new Worker('resources/worker.js');
|
||||
worker.onmessage = function(event) {
|
||||
console.log("received");
|
||||
};
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of serializing a long string.",
|
||||
run: function() {
|
||||
worker.postMessage(str);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 200000;
|
||||
var obj = {}; // obj does not have a 'length' property.
|
||||
for (var i = 0; i < length; i++)
|
||||
obj['key' + i] = i;
|
||||
var worker = new Worker('resources/worker.js');
|
||||
worker.onmessage = function(event) {
|
||||
console.log("received");
|
||||
};
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of serializing a large map object.",
|
||||
run: function() {
|
||||
worker.postMessage(obj);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,22 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000;
|
||||
var obj = [];
|
||||
for (var i = 0; i < length; i++)
|
||||
obj = [obj];
|
||||
var worker = new Worker('resources/worker.js');
|
||||
worker.onmessage = function(event) {
|
||||
console.log("received");
|
||||
};
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures performance of serializing a long chaining nested array.",
|
||||
run: function() {
|
||||
worker.postMessage(obj);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo" role="group"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'setAttribute' in Dromaeo/dom-attr.html and other DOM methods that return an undefined.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 10000; i++)
|
||||
localDiv.setAttribute("role", "group");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.getElementById("foo");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'setAttribute' in Dromaeo/dom-attr.html and other DOM methods that return an undefined.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 10000; i++)
|
||||
localDiv.setAttribute("id", "foo");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
StructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of deserializing JSON-like data.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/blink-dev.json")),
|
||||
measure: "deserialize",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
StructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of serializing JSON-like data.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/blink-dev.json")),
|
||||
measure: "serialize",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
// This simulates a long string being sent, such as JSON data as text, or a
|
||||
// large data URI.
|
||||
const log2Length = 23;
|
||||
let str = 'a';
|
||||
for (let i = 0; i < log2Length; i++) str += str;
|
||||
|
||||
StructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of deserializing a long string.",
|
||||
data: str,
|
||||
measure: "deserialize",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
// This simulates a long string being sent, such as JSON data as text, or a
|
||||
// large data URI.
|
||||
const log2Length = 23;
|
||||
let str = 'a';
|
||||
for (let i = 0; i < log2Length; i++) str += str;
|
||||
|
||||
StructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of serializing a long string.",
|
||||
data: str,
|
||||
measure: "serialize",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000000;
|
||||
var source = new Array(length);
|
||||
for (var i = 0; i < length; i++)
|
||||
source[i] = i;
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of creating a Uint8Array from an existing one million element Array which contains integers beyond the range of an unsigned 8-bit integer.",
|
||||
run: function() {
|
||||
var target = new Uint8Array(source);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000000;
|
||||
var source = new Uint8Array(length);
|
||||
for (var i = 0; i < length; i++)
|
||||
source[i] = i;
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of creating a Uint8Array from an existing Uint8Array.",
|
||||
run: function() {
|
||||
var target = new Uint8Array(source);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,18 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000000;
|
||||
var source = new Uint8Array(length);
|
||||
for (var i = 0; i < length; i++)
|
||||
source[i] = i;
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of creating a Float64Array from an existing one million element Uint8Array.",
|
||||
run: function() {
|
||||
var target = new Float64Array(source);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,19 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
|
||||
var length = 1000000;
|
||||
var source = new Uint8Array(length);
|
||||
for (var i = 0; i < length; i++)
|
||||
source[i] = i;
|
||||
var target = new Float64Array(length);
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of setting a Float64Array to a Uint8Array using Float64Array.prototype.set.",
|
||||
run: function() {
|
||||
target.set(source);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers undefined DOM attributes that return a null.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.firstChild;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers 'getElementById (not in document)' in Dromaeo/dom-query.html, and other Node-query methods that return a null.",
|
||||
run: function() {
|
||||
for (var i = 0; i < 100000; i++)
|
||||
document.getElementById("foo");
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,17 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
var div = document.createElement("div");
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "This benchmark covers undefined DOM attributes that return an empty String.",
|
||||
run: function() {
|
||||
var localDiv = div;
|
||||
for (var i = 0; i < 100000; i++)
|
||||
localDiv.id;
|
||||
}});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<canvas id="cvs" style="border: 1px solid black"></canvas>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
function clearThruJS(context, mask) {
|
||||
context.clear(mask);
|
||||
}
|
||||
const clearNoJS =
|
||||
Function.prototype.call.bind(WebGLRenderingContext.prototype.clear);
|
||||
|
||||
const imports = {
|
||||
'../clearCalls.js': {
|
||||
'clearThruJS': clearThruJS,
|
||||
'clearNoJS': clearNoJS
|
||||
}
|
||||
};
|
||||
fetch("resources/wasm_webgpu.wasm").then(
|
||||
response => response.arrayBuffer()).then(
|
||||
buffer => {console.log(buffer); return WebAssembly.compile(buffer)}).then(
|
||||
wasmModule => WebAssembly.instantiate(wasmModule, imports)).then(
|
||||
instance => {
|
||||
const testFuncNoJS = instance.exports.clearManyTimesNoJS;
|
||||
const gl = cvs.getContext("webgl");
|
||||
const kClearsPerIteration = 1_000_000;
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Test direct calls from WebAssembly to ' +
|
||||
'WebGLRenderingContext.prototype.clear, enabled by ' +
|
||||
'Function.prototype.call.bind',
|
||||
setup: function() {},
|
||||
run: function() {
|
||||
testFuncNoJS(gl, kClearsPerIteration);
|
||||
},
|
||||
iterationCount: 5
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,41 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<canvas id="cvs" style="border: 1px solid black"></canvas>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script>
|
||||
function clearThruJS(context, mask) {
|
||||
context.clear(mask);
|
||||
}
|
||||
const clearNoJS =
|
||||
Function.prototype.call.bind(WebGLRenderingContext.prototype.clear);
|
||||
|
||||
const imports = {
|
||||
'../clearCalls.js': {
|
||||
'clearThruJS': clearThruJS,
|
||||
'clearNoJS': clearNoJS
|
||||
}
|
||||
};
|
||||
fetch("resources/wasm_webgpu.wasm").then(
|
||||
response => response.arrayBuffer()).then(
|
||||
buffer => {console.log(buffer); return WebAssembly.compile(buffer)}).then(
|
||||
wasmModule => WebAssembly.instantiate(wasmModule, imports)).then(
|
||||
instance => {
|
||||
const testFuncThruJS = instance.exports.clearManyTimesThruJS;
|
||||
const gl = cvs.getContext("webgl");
|
||||
const kClearsPerIteration = 1_000_000;
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Test calls from WebAssembly to ' +
|
||||
'WebGLRenderingContext.prototype.clear through ' +
|
||||
'JavaScript',
|
||||
setup: function() {},
|
||||
run: function() {
|
||||
testFuncThruJS(gl, kClearsPerIteration);
|
||||
},
|
||||
iterationCount: 5
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-different-payloads-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredCloneDifferentPayloadsPerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of worker round-trip with structured clone, for JSON-like data where different payloads are sent back and forth.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/preact-to-worker.json")),
|
||||
measure: "roundtrip",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending JSON-like data from a worker back to the main thread using deserialization.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/blink-dev.json")),
|
||||
measure: "fromWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of worker round-trip with structured clone, for JSON-like data.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/blink-dev.json")),
|
||||
measure: "roundtrip",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending JSON-like data to a worker with deserialization.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/blink-dev.json")),
|
||||
measure: "toWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending JSON data representing a Worker DOM DBMon from a worker back to the main thread using deserialization.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/WorkerDOM-DBMon.json")),
|
||||
measure: "fromWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-structured-clone-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerStructuredClonePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending JSON data representing a Worker DOM Map from a worker back to the main thread using deserialization.",
|
||||
data: JSON.parse(PerfTestRunner.loadFile("resources/data/WorkerDOM-Map.json")),
|
||||
measure: "fromWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-text-encoded-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerTextEncodedTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending text encoded JSON data back to the main thread from a worker",
|
||||
data: PerfTestRunner.loadFile("resources/data/blink-dev.json"),
|
||||
measure: "fromWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-text-encoded-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerTextEncodedTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of worker round-trip with text-encoded data sent as a transferable.",
|
||||
data: PerfTestRunner.loadFile("resources/data/blink-dev.json"),
|
||||
measure: "roundtrip",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-text-encoded-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
WorkerTextEncodedTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of encoding JSON data to send to worker thread as a transferable",
|
||||
data: PerfTestRunner.loadFile("resources/data/blink-dev.json"),
|
||||
measure: "toWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
var data = new Uint32Array(10485760);
|
||||
for (var i = 0; i < data.length; i++) { data[i] = i; }
|
||||
WorkerTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending an array buffer as a transferable to the main thread from a worker.",
|
||||
data: data.buffer,
|
||||
measure: "fromWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
var data = new Uint32Array(10485760);
|
||||
for (var i = 0; i < data.length; i++) { data[i] = i; }
|
||||
WorkerTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of worker round-trip using transferable to send an array buffer.",
|
||||
data: data.buffer,
|
||||
measure: "roundtrip",
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE html>
|
||||
<body>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/worker-transferable-perf-test.js"></script>
|
||||
<script>
|
||||
var data = new Uint32Array(10485760);
|
||||
for (var i = 0; i < data.length; i++) { data[i] = i; }
|
||||
WorkerTransferablePerfTestRunner.measureTimeAsync({
|
||||
description: "Measures performance of sending an array buffer as a transferable to a worker.",
|
||||
data: data.buffer,
|
||||
measure: "toWorker",
|
||||
});
|
||||
</script>
|
||||
</body>
|
40
tests/blink_perf_tests/perf_tests/css/AtScope.html
Normal file
40
tests/blink_perf_tests/perf_tests/css/AtScope.html
Normal file
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="./resources/utils.js"></script>
|
||||
<style id=style></style>
|
||||
<div id=root class=myscope></div>
|
||||
<script>
|
||||
const SELECTORS = 1000;
|
||||
|
||||
function makeStyle() {
|
||||
let selectors = [...Array(SELECTORS).keys()].map(x => `.a${x}`);
|
||||
// Creates a selector list which is expensive to evaluate:
|
||||
// (.a1, .a2, .a3 ... .a<n-1>, .myscope)
|
||||
return `
|
||||
@scope (${selectors.join(',')}, .myscope) {
|
||||
div {
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
function setup() {
|
||||
style.textContent = makeStyle();
|
||||
createDOMTree(root, /* siblings */ 2, /* depth */ 11);
|
||||
}
|
||||
|
||||
setup();
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: '@scope with many ancestors',
|
||||
run: () => {
|
||||
root.offsetTop;
|
||||
root.classList.toggle('myscope');
|
||||
root.offsetTop;
|
||||
root.classList.toggle('myscope');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
70
tests/blink_perf_tests/perf_tests/css/AtScopeAncestor.html
Normal file
70
tests/blink_perf_tests/perf_tests/css/AtScopeAncestor.html
Normal file
|
@ -0,0 +1,70 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="./resources/utils.js"></script>
|
||||
<style id=style></style>
|
||||
<div id=root></div>
|
||||
<script>
|
||||
const SELECTORS = 1000;
|
||||
const DOM_WIDTH = 10;
|
||||
const DOM_DEPTH = 1000;
|
||||
|
||||
function makeStyle() {
|
||||
let selectors = [...Array(SELECTORS).keys()].map(x => `.a${x}`);
|
||||
// Creates a selector list which is expensive to evaluate:
|
||||
// (.a1, .a2, .a3 ... .a<n-1>, ...)
|
||||
return `
|
||||
@scope (:not(:is(${selectors.join(',')})).foo) {
|
||||
div:empty:not(.bar) {
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
function makeChain(n) {
|
||||
if (n <= 0) {
|
||||
return null;
|
||||
}
|
||||
let element = document.createElement('div');
|
||||
let child = makeChain(n - 1);
|
||||
if (child != null) {
|
||||
element.appendChild(child);
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
let leaf_nodes = [];
|
||||
|
||||
function setup() {
|
||||
style.textContent = makeStyle();
|
||||
|
||||
for (let i = 0; i < DOM_WIDTH; ++i) {
|
||||
root.appendChild(makeChain(DOM_DEPTH));
|
||||
}
|
||||
|
||||
leaf_nodes = document.querySelectorAll('div:empty');
|
||||
}
|
||||
|
||||
setup();
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Non-matching ancestor via :scope',
|
||||
run: () => {
|
||||
root.offsetTop;
|
||||
for (let e of leaf_nodes) {
|
||||
e.classList.toggle('bar');
|
||||
}
|
||||
root.offsetTop;
|
||||
for (let e of leaf_nodes) {
|
||||
e.classList.toggle('bar');
|
||||
}
|
||||
root.offsetTop;
|
||||
for (let e of leaf_nodes) {
|
||||
e.classList.toggle('bar');
|
||||
}
|
||||
root.offsetTop;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
42
tests/blink_perf_tests/perf_tests/css/AtScopeInsertion.html
Normal file
42
tests/blink_perf_tests/perf_tests/css/AtScopeInsertion.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="./resources/utils.js"></script>
|
||||
<div id=container></div>
|
||||
<div id=root class=myscope></div>
|
||||
<script>
|
||||
const SELECTORS = 2000;
|
||||
|
||||
let style = document.createElement('style');
|
||||
|
||||
function makeStyle() {
|
||||
let selectors = [...Array(SELECTORS).keys()].map(x => `.a${x}`);
|
||||
// Creates a selector list which is expensive to evaluate:
|
||||
// (.a1, .a2, .a3 ... .a<n-1>, .myscope)
|
||||
return `
|
||||
@scope (${selectors.join(',')}, .myscope) {
|
||||
div {
|
||||
margin: 1px;
|
||||
}
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
function setup() {
|
||||
style.textContent = makeStyle();
|
||||
createDOMTree(root, /* siblings */ 1, /* depth */ 50);
|
||||
}
|
||||
|
||||
setup();
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Inserting @scope with a deep tree',
|
||||
run: () => {
|
||||
container.append(style);
|
||||
root.offsetTop;
|
||||
style.remove();
|
||||
root.offsetTop;
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<style>
|
||||
[attr=root] [attr=child] {}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
<script>
|
||||
function addChildren(element, numChildren, idPrefix)
|
||||
{
|
||||
for (var i = 0; i < numChildren; i++) {
|
||||
var child = document.createElement("div");
|
||||
child.id = idPrefix + i;
|
||||
element.appendChild(child);
|
||||
}
|
||||
}
|
||||
|
||||
function makeTree(element, depth, fanOut, idPrefix)
|
||||
{
|
||||
if (depth <= 0)
|
||||
return;
|
||||
addChildren(element, fanOut, idPrefix);
|
||||
for (var child = element.firstChild; child.nextSibling; child = child.nextSibling) {
|
||||
makeTree(child, depth - 1, fanOut, child.id);
|
||||
}
|
||||
if (child)
|
||||
makeTree(child, depth - 1, fanOut, child.id);
|
||||
}
|
||||
|
||||
var root = document.querySelector("#root");
|
||||
makeTree(root, 6, 5, "child");
|
||||
|
||||
var child = document.querySelector("#child012341");
|
||||
child.setAttribute("attr", "child");
|
||||
var runFunction = function()
|
||||
{
|
||||
root.offsetHeight; // force recalc style
|
||||
root.setAttribute("attr" , "root");
|
||||
root.offsetHeight;
|
||||
root.removeAttribute("attr");
|
||||
}
|
||||
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of the CSS attribute descendant selector ([a=b] [c=d]).",
|
||||
run: runFunction
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
53
tests/blink_perf_tests/perf_tests/css/BigContainerQuery.html
Normal file
53
tests/blink_perf_tests/perf_tests/css/BigContainerQuery.html
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<style>
|
||||
#container {
|
||||
width: 200px;
|
||||
}
|
||||
.inline_size {
|
||||
container-type: inline-size;
|
||||
}
|
||||
</style>
|
||||
<div id=container>
|
||||
<div id=target></div>
|
||||
</div>
|
||||
<style id=style></style>
|
||||
<script>
|
||||
|
||||
// Makes a big container query as follows:
|
||||
//
|
||||
// @container ((width = 1000px) or (width = 1001px) or ... (width = (1000+n)px) or (width = 200px)) {
|
||||
// #target {}
|
||||
// #target {}
|
||||
// ... n times in total ...
|
||||
// #target {}
|
||||
// }
|
||||
function makeQuery(n) {
|
||||
let expressions = [];
|
||||
let rules = [];
|
||||
for (let i = 0; i < n; i++) {
|
||||
expressions.push(`(width = ${1000+i}px)`);
|
||||
rules.push('#target { }');
|
||||
}
|
||||
expressions.push(`(width = 200px)`);
|
||||
return `@container (${expressions.join(' or ')}) { ${rules.join('\n') } }`;
|
||||
}
|
||||
|
||||
function setup() {
|
||||
style.textContent = makeQuery(1000);
|
||||
}
|
||||
|
||||
setup();
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Big container query with many inner rules',
|
||||
run: () => {
|
||||
target.offsetTop;
|
||||
container.classList.toggle('inline_size');
|
||||
target.offsetTop;
|
||||
container.classList.toggle('inline_size');
|
||||
}
|
||||
});
|
||||
|
||||
</script>
|
||||
|
32
tests/blink_perf_tests/perf_tests/css/CSSCountersCreate.html
Normal file
32
tests/blink_perf_tests/perf_tests/css/CSSCountersCreate.html
Normal file
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<style>
|
||||
div {
|
||||
counter-increment: my-counter;
|
||||
}
|
||||
div::before {
|
||||
content: counter(my-counter);
|
||||
}
|
||||
</style>
|
||||
<body></body>
|
||||
<script>
|
||||
function createTree(root, num_elements, depth) {
|
||||
if (!depth) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < num_elements; ++i) {
|
||||
const div = document.createElement('div');
|
||||
root.append(div);
|
||||
createTree(div, num_elements, depth - 1);
|
||||
}
|
||||
}
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Measure the time of the css counters creation',
|
||||
run: function() {
|
||||
document.body.innerHTML = '';
|
||||
createTree(document.body, 5, 6);
|
||||
},
|
||||
iterationCount: 5,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,40 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
<style>
|
||||
body.default_ltr .default { direction: ltr; }
|
||||
body.default_ltr .alternative { direction: rtl; }
|
||||
|
||||
body.default_rtl .default { direction: rtl; }
|
||||
body.default_rtl .alternative { direction: ltr; }
|
||||
div { margin-inline-start: 10px; }
|
||||
/* Give the cascade something to do: */
|
||||
div { border: 0px solid red; }
|
||||
div { border: 0px solid green !important; }
|
||||
div { border: 0px solid black; }
|
||||
div { padding: 0px; }
|
||||
</style>
|
||||
<body class="default_ltr"></body>
|
||||
<script>
|
||||
|
||||
function createTree(node, siblings, depth) {
|
||||
if (!depth)
|
||||
return;
|
||||
for (let i = 0; i < siblings; i++) {
|
||||
var div = document.createElement('div');
|
||||
div.className = (depth % 2 == 0) ? 'default' : 'alternative';
|
||||
node.append(div);
|
||||
createTree(div, siblings, depth - 1);
|
||||
}
|
||||
}
|
||||
createTree(document.body, 4, 6);
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Measure impact of switching direction with css-logical',
|
||||
run: function() {
|
||||
document.body.classList.toggle('default_ltr');
|
||||
document.body.classList.toggle('default_rtl');
|
||||
forceStyleRecalc(document.body);
|
||||
}
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="test"></div>
|
||||
</body>
|
||||
<script>
|
||||
var div = document.getElementById("test");
|
||||
var properties = {
|
||||
'azimuth' : 'right',
|
||||
'backgroundColor' : 'green',
|
||||
'backgroundImage' : 'url(\'test.png\')',
|
||||
'backgroundPosition' : 'top',
|
||||
'backgroundRepeat' : 'repeat-x',
|
||||
'background' : '#ffffff url(\'img_tree.png\') no-repeat right top',
|
||||
'border' : '20px dotted red',
|
||||
'borderBottomStyle' : 'dotted',
|
||||
'borderCollapse' : 'separate',
|
||||
'borderColor' : 'blue',
|
||||
'borderSpacing' : '3px',
|
||||
'borderStyle' : 'solid',
|
||||
'borderTop' : 'green',
|
||||
'borderWidth' : '20em',
|
||||
'bottom' : '20%',
|
||||
'captionSide' : 'top',
|
||||
'clear' : 'both',
|
||||
'clip' : 'rect(5px, 40px, 45px, 5px)',
|
||||
'color' : 'red',
|
||||
'content' : 'normal',
|
||||
'direction' : 'rtl',
|
||||
'display' : 'block',
|
||||
'cssFloat' : 'right',
|
||||
'fontFamily' : '"Times New Roman",Georgia,Serif',
|
||||
'fontSize' : '13px',
|
||||
'fontVariant' : 'small-caps',
|
||||
'fontWeight' : '700',
|
||||
'font' : 'italic bold 12px/30px Georgia, serif',
|
||||
'height' : '200px',
|
||||
'left' : '20%',
|
||||
'letterSpacing' : '10px',
|
||||
'lineHeight' : '40px',
|
||||
'listStyleImage' : 'url(\'test.png\')',
|
||||
'listStylePosition' : 'outside',
|
||||
'listStyleType' : 'decimal',
|
||||
'listStyle' : 'circle inside',
|
||||
'marginRight' : '50px',
|
||||
'margin' : '10px 20px 30px 5em',
|
||||
'maxHeight' : '700px',
|
||||
'maxWidth' : '300px',
|
||||
'minHeight' : '100px',
|
||||
'minWidth' : '100px',
|
||||
'outlineColor' : 'gray',
|
||||
'outlineStyle' : 'dotted',
|
||||
'outlineWidth' : '5px',
|
||||
'paddingTop' : '30px',
|
||||
'padding' : '30px 20px 10px 50px',
|
||||
'pageBreakAfter' : 'always',
|
||||
'pageBreakInside' : 'auto',
|
||||
'pause' : '2s',
|
||||
'position' : 'static',
|
||||
'right' : '150px',
|
||||
'textAlign' : 'center',
|
||||
'textDecoration' : 'blink',
|
||||
'textTransform' : 'capitalize',
|
||||
'top' : '25%',
|
||||
'verticalAlign' : 'text-bottom',
|
||||
'visibility' : 'visible',
|
||||
'width' : '300px',
|
||||
'webkitTransform' : 'scale3d(0.5, 0.5, 0.5)',
|
||||
'wordSpacing' : '40px',
|
||||
};
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of the CSS style array index getter and setter (a = elem.style[b], elem.style[c] = d).",
|
||||
run:function() {
|
||||
for (key in properties) {
|
||||
var value = div.style[key];
|
||||
div.style[key] = "";
|
||||
div.style[key] = properties[key];
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,85 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="test"></div>
|
||||
</body>
|
||||
<script>
|
||||
var div = document.getElementById("test");
|
||||
var properties = {
|
||||
'azimuth' : 'right',
|
||||
'background-color' : 'green',
|
||||
'background-image' : 'url(\'test.png\')',
|
||||
'background-position' : 'top',
|
||||
'background-repeat' : 'repeat-x',
|
||||
'background' : '#ffffff url(\'img_tree.png\') no-repeat right top',
|
||||
'border' : '20px dotted red',
|
||||
'border-bottom-style' : 'dotted',
|
||||
'border-collapse' : 'separate',
|
||||
'border-color' : 'blue',
|
||||
'border-spacing' : '3px',
|
||||
'border-style' : 'solid',
|
||||
'border-top' : 'green',
|
||||
'border-width' : '20em',
|
||||
'bottom' : '20%',
|
||||
'caption-side' : 'top',
|
||||
'clear' : 'both',
|
||||
'clip' : 'rect(5px, 40px, 45px, 5px)',
|
||||
'color' : 'red',
|
||||
'content' : 'normal',
|
||||
'direction' : 'rtl',
|
||||
'display' : 'block',
|
||||
'css-float' : 'right',
|
||||
'font-family' : '"Times New Roman",Georgia,Serif',
|
||||
'font-size' : '13px',
|
||||
'font-variant' : 'small-caps',
|
||||
'font-weight' : '700',
|
||||
'font' : 'italic bold 12px/30px Georgia, serif',
|
||||
'height' : '200px',
|
||||
'left' : '20%',
|
||||
'letter-spacing' : '10px',
|
||||
'line-height' : '40px',
|
||||
'list-style-image' : 'url(\'test.png\')',
|
||||
'list-style-position' : 'outside',
|
||||
'list-style-type' : 'decimal',
|
||||
'list-style' : 'circle inside',
|
||||
'margin-right' : '50px',
|
||||
'margin' : '10px 20px 30px 5em',
|
||||
'max-height' : '700px',
|
||||
'max-width' : '300px',
|
||||
'min-height' : '100px',
|
||||
'min-width' : '100px',
|
||||
'outline-color' : 'gray',
|
||||
'outline-style' : 'dotted',
|
||||
'outline-width' : '5px',
|
||||
'padding-top' : '30px',
|
||||
'padding' : '30px 20px 10px 50px',
|
||||
'page-break-after' : 'always',
|
||||
'page-break-inside' : 'auto',
|
||||
'pause' : '2s',
|
||||
'position' : 'static',
|
||||
'right' : '150px',
|
||||
'text-align' : 'center',
|
||||
'text-decoration' : 'blink',
|
||||
'text-transform' : 'capitalize',
|
||||
'top' : '25%',
|
||||
'vertical-align' : 'text-bottom',
|
||||
'visibility' : 'visible',
|
||||
'width' : '300px',
|
||||
'webkit-transform' : 'scale3d(0.5, 0.5, 0.5)',
|
||||
'word-spacing' : '40px',
|
||||
};
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of the CSS style getter and setter methods (elem.style.(getPropertyValue|removeProperty|setProperty)).",
|
||||
run:function() {
|
||||
for (key in properties) {
|
||||
var value = div.style.getPropertyValue(key);
|
||||
div.style.removeProperty(key);
|
||||
div.style.setProperty(key, properties[key]);
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,83 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="test"></div>
|
||||
</body>
|
||||
<script>
|
||||
var div = document.getElementById("test");
|
||||
var properties = {
|
||||
'azimuth' : 'right',
|
||||
'backgroundColor' : 'green',
|
||||
'backgroundImage' : 'url(\'test.png\')',
|
||||
'backgroundPosition' : 'top',
|
||||
'backgroundRepeat' : 'repeat-x',
|
||||
'background' : '#ffffff url(\'img_tree.png\') no-repeat right top',
|
||||
'border' : '20px dotted red',
|
||||
'borderBottomStyle' : 'dotted',
|
||||
'borderCollapse' : 'separate',
|
||||
'borderColor' : 'blue',
|
||||
'borderSpacing' : '3px',
|
||||
'borderStyle' : 'solid',
|
||||
'borderTop' : 'green',
|
||||
'borderWidth' : '20em',
|
||||
'bottom' : '20%',
|
||||
'captionSide' : 'top',
|
||||
'clear' : 'both',
|
||||
'clip' : 'rect(5px, 40px, 45px, 5px)',
|
||||
'color' : 'red',
|
||||
'content' : 'normal',
|
||||
'direction' : 'rtl',
|
||||
'display' : 'block',
|
||||
'cssFloat' : 'right',
|
||||
'fontFamily' : '"Times New Roman",Georgia,Serif',
|
||||
'fontSize' : '13px',
|
||||
'fontVariant' : 'small-caps',
|
||||
'fontWeight' : '700',
|
||||
'font' : 'italic bold 12px/30px Georgia, serif',
|
||||
'height' : '200px',
|
||||
'left' : '20%',
|
||||
'letterSpacing' : '10px',
|
||||
'lineHeight' : '40px',
|
||||
'listStyleImage' : 'url(\'test.png\')',
|
||||
'listStylePosition' : 'outside',
|
||||
'listStyleType' : 'decimal',
|
||||
'listStyle' : 'circle inside',
|
||||
'marginRight' : '50px',
|
||||
'margin' : '10px 20px 30px 5em',
|
||||
'maxHeight' : '700px',
|
||||
'maxWidth' : '300px',
|
||||
'minHeight' : '100px',
|
||||
'minWidth' : '100px',
|
||||
'outlineColor' : 'gray',
|
||||
'outlineStyle' : 'dotted',
|
||||
'outlineWidth' : '5px',
|
||||
'paddingTop' : '30px',
|
||||
'padding' : '30px 20px 10px 50px',
|
||||
'pageBreakAfter' : 'always',
|
||||
'pageBreakInside' : 'auto',
|
||||
'pause' : '2s',
|
||||
'position' : 'static',
|
||||
'right' : '150px',
|
||||
'textAlign' : 'center',
|
||||
'textDecoration' : 'blink',
|
||||
'textTransform' : 'capitalize',
|
||||
'top' : '25%',
|
||||
'verticalAlign' : 'text-bottom',
|
||||
'visibility' : 'visible',
|
||||
'width' : '300px',
|
||||
'webkitTransform' : 'scale3d(0.5, 0.5, 0.5)',
|
||||
'wordSpacing' : '40px',
|
||||
};
|
||||
// The first run will just add the properties but it's fine as the first run of the benchmark is always ignored.
|
||||
PerfTestRunner.measureRunsPerSecond({
|
||||
description: "Measures performance of the CSS style array index setter (elem.style[a] = b).",
|
||||
run:function() {
|
||||
for (key in properties)
|
||||
div.style[key] = properties[key];
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</html>
|
35
tests/blink_perf_tests/perf_tests/css/CSSQuotesCreate.html
Normal file
35
tests/blink_perf_tests/perf_tests/css/CSSQuotesCreate.html
Normal file
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<style>
|
||||
div {
|
||||
quotes: "A" "Z";
|
||||
}
|
||||
div::before {
|
||||
content: open-quote;
|
||||
}
|
||||
div::after {
|
||||
content: close-quote;
|
||||
}
|
||||
</style>
|
||||
<body></body>
|
||||
<script>
|
||||
function createTree(root, num_elements, depth) {
|
||||
if (!depth) {
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < num_elements; ++i) {
|
||||
const div = document.createElement('div');
|
||||
root.append(div);
|
||||
createTree(div, num_elements, depth - 1);
|
||||
}
|
||||
}
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: 'Measure the time of the css quotes creation',
|
||||
run: function() {
|
||||
document.body.innerHTML = '';
|
||||
createTree(document.body, 5, 6);
|
||||
},
|
||||
iterationCount: 5,
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,98 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>CSS Custom Properties and Variables: Changes that require resolving variable references</title>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
.container > div {
|
||||
display: inline-block;
|
||||
height: 14px;
|
||||
width: 14px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid green;
|
||||
}
|
||||
.container {
|
||||
height: 0px;
|
||||
overflow: hidden;
|
||||
}
|
||||
</style>
|
||||
<body>
|
||||
<header id=info>CSS Variables: <button id=button></button></header>
|
||||
<script>
|
||||
const NUM_ELEMENTS = 20000;
|
||||
const PROP_COUNT = 1000;
|
||||
let curBorder = -1;
|
||||
let root = document.createElement('div');
|
||||
root.classList.add(`container`);
|
||||
|
||||
// Add ?ref to URL to run a similar test without CSS Variables.
|
||||
const ref = document.location.href.endsWith('?ref');
|
||||
button.textContent = ref ? 'OFF' : 'ON';
|
||||
button.addEventListener('click', function(){
|
||||
let href = document.location.href;
|
||||
if (ref) {
|
||||
document.location.href = href.substr(0, href.length - 4);
|
||||
} else {
|
||||
document.location.href = href + '?ref';
|
||||
}
|
||||
});
|
||||
|
||||
function hexcolor(i) {
|
||||
let hex = i.toString(16);
|
||||
while (hex.length < 6)
|
||||
hex = '0' + hex;
|
||||
return '#' + hex;
|
||||
}
|
||||
|
||||
function createDOMTree() {
|
||||
for (let n = 0; n < NUM_ELEMENTS; n++) {
|
||||
let div = document.createElement('div');
|
||||
let i = n % PROP_COUNT;
|
||||
div.classList.add(`bg-color${i}`);
|
||||
root.appendChild(div);
|
||||
}
|
||||
document.body.appendChild(root);
|
||||
}
|
||||
|
||||
function createDivRules() {
|
||||
let lines = [];
|
||||
for (let i = 0; i < PROP_COUNT; i++) {
|
||||
lines.push(`.border${i} > div { border-color: ${hexcolor(i)}; }`);
|
||||
if (ref)
|
||||
lines.push(`.bg-color${i} { background-color: ${hexcolor(i)}; }`);
|
||||
else
|
||||
lines.push(`.bg-color${i} { background-color: var(--prop-${i}); }`);
|
||||
}
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
// Create a rule which defines 'propCount' custom properties at :root.
|
||||
function createRootRule() {
|
||||
if (ref)
|
||||
return;
|
||||
let lines = [':root {'];
|
||||
for (let i = 0; i < PROP_COUNT; i++) {
|
||||
lines.push(`--prop-${i}: ${hexcolor(i)};`);
|
||||
}
|
||||
lines.push('}');
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
applyCSSRule(createDivRules());
|
||||
applyCSSRule(createRootRule());
|
||||
createDOMTree();
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of the CSS variable reference recalc.",
|
||||
setup: () => {
|
||||
root.classList.remove(`border${curBorder}`);
|
||||
// Using PROP_COUNT to ensure different border values, avoiding the style cache
|
||||
curBorder = (curBorder + 1) % PROP_COUNT;
|
||||
},
|
||||
run: function() {
|
||||
root.classList.add(`border${curBorder}`);
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,36 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
createRegularDOMTree();
|
||||
var allElements = document.body.getElementsByTagName("div");
|
||||
for (var i = 0; i < allElements.length; ++i) {
|
||||
if (i % 2 == 0) {
|
||||
allElements[i].className = "a";
|
||||
} else {
|
||||
allElements[i].className = "b";
|
||||
}
|
||||
}
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of a child class selector.",
|
||||
run: function() {
|
||||
var rule = applyCSSRule(".a > .b { cursor: crosshair; }");
|
||||
forceStyleRecalc(document.body);
|
||||
rule.remove();
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
tracingCategories: 'blink',
|
||||
traceEventsToMeasure: [
|
||||
'Document::updateStyle',
|
||||
'Document::recalcStyle',
|
||||
'Document::rebuildLayoutTree'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
createRegularDOMTree();
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of applying a style on the div child of a div.",
|
||||
run: function() {
|
||||
var rule = applyCSSRule("div div { cursor: crosshair; }");
|
||||
forceStyleRecalc(document.body);
|
||||
rule.remove();
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
tracingCategories: 'blink',
|
||||
traceEventsToMeasure: [
|
||||
'Document::updateStyle',
|
||||
'Document::recalcStyle',
|
||||
'Document::rebuildLayoutTree'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,35 @@
|
|||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>CSS Custom Properties and Variables: Changes in property's declaration</title>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<style>
|
||||
.crosshair { --prop: crosshair; }
|
||||
.default { --prop: default; }
|
||||
body > div > div { background-color: grey; }
|
||||
</style>
|
||||
<body>
|
||||
<script>
|
||||
function createDOMTree() {
|
||||
let div = document.createElement('div');
|
||||
div.innerHTML = '<div><div><div><div><div style="cursor: var(--prop)">' + '' + '</div></div></div></div></div>';
|
||||
for (let i = 0; i < 10000; i++) {
|
||||
document.body.appendChild(div.cloneNode(true));
|
||||
}
|
||||
}
|
||||
createDOMTree();
|
||||
var theme;
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance in the propagation of a custom property declaration.",
|
||||
setup: () => {
|
||||
document.body.classList.remove(theme);
|
||||
theme = theme == 'crosshair' ? 'default' : 'crosshair';
|
||||
},
|
||||
run: function() {
|
||||
document.body.classList.add(theme);
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
});
|
||||
</script>
|
||||
</body>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
createRegularDOMTree();
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of applying a style on all divs.",
|
||||
run: function() {
|
||||
var rule = applyCSSRule("div { cursor: crosshair; }");
|
||||
forceStyleRecalc(document.body);
|
||||
rule.remove();
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
tracingCategories: 'blink',
|
||||
traceEventsToMeasure: [
|
||||
'Document::updateStyle',
|
||||
'Document::recalcStyle',
|
||||
'Document::rebuildLayoutTree'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,27 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
<script>
|
||||
createRegularDOMTree();
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of applying a style on the div grandchild of a div.",
|
||||
run: function() {
|
||||
var rule = applyCSSRule("div div div { cursor: crosshair; }");
|
||||
forceStyleRecalc(document.body);
|
||||
rule.remove();
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
tracingCategories: 'blink',
|
||||
traceEventsToMeasure: [
|
||||
'Document::updateStyle',
|
||||
'Document::recalcStyle',
|
||||
'Document::rebuildLayoutTree'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
</html>
|
|
@ -0,0 +1,32 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script src="../resources/runner.js"></script>
|
||||
<script src="resources/utils.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
createRegularDOMTree();
|
||||
var allElements = document.body.getElementsByTagName("div");
|
||||
for (var i = 0; i < allElements.length; ++i) {
|
||||
allElements[i].className = "a b";
|
||||
}
|
||||
|
||||
PerfTestRunner.measureTime({
|
||||
description: "Measures the performance of multiple class selectors.",
|
||||
run: function() {
|
||||
var rule = applyCSSRule(".a .b { cursor: crosshair; }");
|
||||
forceStyleRecalc(document.body);
|
||||
rule.remove();
|
||||
forceStyleRecalc(document.body);
|
||||
},
|
||||
tracingCategories: 'blink',
|
||||
traceEventsToMeasure: [
|
||||
'Document::updateStyle',
|
||||
'Document::recalcStyle',
|
||||
'Document::rebuildLayoutTree'
|
||||
]
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue