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 a8e8048 commit c3e3b6e
Show file tree
Hide file tree
Showing 5 changed files with 224 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 @@ -314,6 +314,11 @@ FOR_EACH_JS_GLEAN_METRIC
(
_
)
_
(
ION_COMPILE_TIME
TimeDuration_US
)
#
define
FOR_EACH_JS_METRIC
Expand Down
34 changes: 34 additions & 0 deletions js/src/jit/CodeGenerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1081,6 +1081,34 @@ data
;
#
endif
void
setCompilationTime
(
mozilla
:
:
TimeDuration
duration
)
{
compileTime_
=
duration
;
}
mozilla
:
:
TimeDuration
getCompilationTime
(
)
const
{
return
compileTime_
;
}
private
:
void
Expand Down Expand Up @@ -2166,6 +2194,12 @@ perfSpewer_
uint32_t
zoneStubsToReadBarrier_
;
mozilla
:
:
TimeDuration
compileTime_
;
#
ifdef
FUZZING_JS_FUZZILLI
Expand Down
77 changes: 76 additions & 1 deletion js/src/jit/Ion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2463,6 +2463,35 @@ return
false
;
}
if
(
mozilla
:
:
TimeDuration
compileTime
=
codegen
-
>
getCompilationTime
(
)
)
{
cx
-
>
metrics
(
)
.
ION_COMPILE_TIME
(
compileTime
)
;
}
return
true
;
Expand Down Expand Up @@ -9134,6 +9163,22 @@ spewEndFunction
mir
)
;
mozilla
:
:
TimeStamp
compileStartTime
=
mozilla
:
:
TimeStamp
:
:
Now
(
)
;
{
WarpCompilation
comp
Expand Down Expand Up @@ -9204,13 +9249,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 @@ -14941,6 +14941,33 @@ sample
;
break
;
case
JSMetric
:
:
ION_COMPILE_TIME
:
glean
:
:
javascript_ion
:
:
compile_time
.
AccumulateRawDuration
(
TimeDuration
:
:
FromMicroseconds
(
sample
)
)
;
break
;
default
:
break
Expand Down

0 comments on commit c3e3b6e

Please sign in to comment.