Skip to content

Commit

Permalink
Bug 1918166: Record Ion compilation times in new glean histogram java…
Browse files Browse the repository at this point in the history
…script.ion.compile_time. r=tcampbell

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

UltraBlame original commit: 154887438a23bf41d967bfb6f862f96cf301b5ba
  • Loading branch information
marco-c committed Nov 16, 2024
1 parent bfb70b7 commit 478ed00
Show file tree
Hide file tree
Showing 5 changed files with 240 additions and 1 deletion.
5 changes: 5 additions & 0 deletions js/public/friend/UsageStatistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,11 @@ FOR_EACH_JS_GLEAN_METRIC
(
_
)
_
(
ION_COMPILE_TIME
TimeDuration_US
)
#
define
FOR_EACH_JS_METRIC
Expand Down
41 changes: 41 additions & 0 deletions js/src/jit/CodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,34 @@ data
;
#
endif
void
setCompilationTime
(
mozilla
:
:
TimeDuration
duration
)
{
compileTime_
=
duration
;
}
mozilla
:
:
TimeDuration
getCompilationTime
(
)
const
{
return
compileTime_
;
}
private
:
void
Expand Down Expand Up @@ -2594,6 +2622,19 @@ barriered
uint32_t
zoneStubsToReadBarrier_
;
/
/
Total
Ion
compilation
time
.
mozilla
:
:
TimeDuration
compileTime_
;
#
ifdef
FUZZING_JS_FUZZILLI
Expand Down
86 changes: 85 additions & 1 deletion js/src/jit/Ion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2699,6 +2699,44 @@ return
false
;
}
/
/
Record
Ion
compile
time
in
glean
.
if
(
mozilla
:
:
TimeDuration
compileTime
=
codegen
-
>
getCompilationTime
(
)
)
{
cx
-
>
metrics
(
)
.
ION_COMPILE_TIME
(
compileTime
)
;
}
return
true
;
Expand Down Expand Up @@ -10404,6 +10442,22 @@ spewEndFunction
mir
)
;
mozilla
:
:
TimeStamp
compileStartTime
=
mozilla
:
:
TimeStamp
:
:
Now
(
)
;
{
WarpCompilation
comp
Expand Down Expand Up @@ -10474,13 +10528,43 @@ return
nullptr
;
}
return
CodeGenerator
*
codegen
=
GenerateCode
(
mir
lir
)
;
if
(
codegen
)
{
codegen
-
>
setCompilationTime
(
mozilla
:
:
TimeStamp
:
:
Now
(
)
-
compileStartTime
)
;
}
return
codegen
;
}
static
AbortReasonOr
Expand Down
82 changes: 82 additions & 0 deletions js/xpconnect/metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,88 @@ expires
never
javascript
.
ion
:
compile_time
:
type
:
timing_distribution
time_unit
:
microsecond
description
:
>
Time
in
microseconds
of
an
Ion
compilation
.
bugs
:
-
https
:
/
/
bugzilla
.
mozilla
.
org
/
show_bug
.
cgi
?
id
=
1918166
data_reviews
:
-
https
:
/
/
bugzilla
.
mozilla
.
org
/
show_bug
.
cgi
?
id
=
1918166
notification_emails
:
-
dpalmeiro
mozilla
.
com
-
perf
-
telemetry
-
alerts
mozilla
.
com
expires
:
never
javascript
.
gc
:
total_time
Expand Down
27 changes: 27 additions & 0 deletions js/xpconnect/src/XPCJSRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19072,6 +19072,33 @@ sample
;
break
;
case
JSMetric
:
:
ION_COMPILE_TIME
:
glean
:
:
javascript_ion
:
:
compile_time
.
AccumulateRawDuration
(
TimeDuration
:
:
FromMicroseconds
(
sample
)
)
;
break
;
default
:
/
Expand Down

0 comments on commit 478ed00

Please sign in to comment.