This repository was archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
executable file
·85 lines (70 loc) · 2.25 KB
/
Copy pathindex.html
File metadata and controls
executable file
·85 lines (70 loc) · 2.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!doctype html>
<meta charset="utf8">
<title>Fluent Runtime Performance</title>
<style>
html {
font: 1rem/1.3 Helvetica, Arial, sans-serif;
padding: 10vh 10vw;
max-width: 30rem;
background: #fcfcfc;
color: #111;
}
h2 {
font-size: 1rem;
}
legend {
padding: .33rem .66rem;
font-style: italic;
}
label {
margin-top: 1rem;
display: block;
}
#results {
margin: 1rem 0 5rem;
}
button {
padding: .33rem .66rem;
}
</style>
<script type="module">
import test from "./test.js";
window.test = test;
</script>
<h1>Fluent Runtime</h1>
<p>
Measure the time it takes to parse a long Fluent resource. The test is
run only once to simulate the real-world conditions and to de-bias it
from the impact of the JIT compilation.
</p>
<fieldset>
<legend>Constructed Resource Settings</legend>
<label for="messages">Number of messages: <span>10</span></label>
<input id="messages"
oninput="this.previousElementSibling.firstElementChild.textContent = this.value"
type="range" min="0" max="100" step="10" value="10">
<label for="paragraphs">Number of paragraphs in each message: <span>10</span></label>
<input id="paragraphs"
oninput="this.previousElementSibling.firstElementChild.textContent = this.value"
type="range" min="0" max="100" step="10" value="10">
</fieldset>
<div id="results">
<button onclick="test()">Parse</button>
Elapsed time: <span id="elapsed">???</span> ms
</div>
<h2>Timer Precision</h2>
<p>
Browsers <a
href="https://developer.mozilla.org/en-US/docs/Web/API/Performance/now#Reduced_time_precision">
reduce the precision</a> of <code>performance.now()</code> for privacy
and security reasons. For best results, please temporarily disable this
feature. In Firefox, set the <code>privacy.reduceTimerPrecision</code>
pref to <code>false</code>.
</p>
<h2>Feedback</h2>
<p>
The source code of this page is hosted on <a
href="https://github.com/projectfluent/fluent-runtime-perf">GitHub</a>.
If you have feedback, please submit an issue, or find us in the <a
href="irc://irc.mozilla.org/l20n">#l20n</a> channel on Mozilla IRC.
</p>