@@ -74,6 +74,7 @@ mod _json {
7474 scan_once : PyObjectRef ,
7575 vm : & VirtualMachine ,
7676 ) -> PyResult < PyIterReturn > {
77+ flame_guard ! ( "JsonScanner::parse" ) ;
7778 let c = match s. chars ( ) . next ( ) {
7879 Some ( c) => c,
7980 None => {
@@ -153,6 +154,7 @@ mod _json {
153154 }
154155
155156 fn parse_number ( & self , s : & str , vm : & VirtualMachine ) -> Option < ( PyResult , usize ) > {
157+ flame_guard ! ( "JsonScanner::parse_number" ) ;
156158 let mut has_neg = false ;
157159 let mut has_decimal = false ;
158160 let mut has_exponent = false ;
@@ -213,6 +215,7 @@ mod _json {
213215 }
214216
215217 fn encode_string ( s : & str , ascii_only : bool ) -> String {
218+ flame_guard ! ( "_json::encode_string" ) ;
216219 let mut buf = Vec :: < u8 > :: with_capacity ( s. len ( ) + 2 ) ;
217220 machinery:: write_json_string ( s, ascii_only, & mut buf)
218221 // SAFETY: writing to a vec can't fail
@@ -253,6 +256,7 @@ mod _json {
253256 strict : OptionalArg < bool > ,
254257 vm : & VirtualMachine ,
255258 ) -> PyResult < ( Wtf8Buf , usize ) > {
259+ flame_guard ! ( "_json::scanstring" ) ;
256260 machinery:: scanstring ( s. as_wtf8 ( ) , end, strict. unwrap_or ( true ) )
257261 . map_err ( |e| py_decode_error ( e, s, vm) )
258262 }
0 commit comments