@@ -75,21 +75,35 @@ describe('Python Configuration Loading', () => {
7575 } ) ;
7676
7777 benchmarkSuite ( 'Function Execution' , {
78- 'checkAuth - sync version' : async ( ) => {
78+ 'checkAuth - sync version (sequential) ' : async ( ) => {
7979 await configPy . checkAuth ! ( { requestId : 'sync-bench' } , 'SYNC_TOKEN' ) ;
8080 } ,
8181
82- 'checkAuth - async version' : async ( ) => {
82+ // It should help to identify any potential issues with GIL
83+ 'checkAuth - sync version (parallel 50x)' : async ( ) => {
84+ await Promise . all (
85+ Array . from ( { length : 50 } , ( ) => configPy . checkAuth ! ( { requestId : 'sync-bench' } , 'SYNC_TOKEN' ) )
86+ ) ;
87+ } ,
88+
89+ 'checkAuth - async version (sequential)' : async ( ) => {
8390 await configAsyncPy . checkAuth ! ( { requestId : 'async-bench' } , 'ASYNC_TOKEN' ) ;
8491 } ,
8592
93+ // It should help to identify any potential issues with GIL
94+ 'checkAuth - async version (parallel 50x)' : async ( ) => {
95+ await Promise . all (
96+ Array . from ( { length : 50 } , ( ) => configAsyncPy . checkAuth ! ( { requestId : 'async-bench' } , 'ASYNC_TOKEN' ) )
97+ ) ;
98+ } ,
99+
86100 'extendContext - sync version' : async ( ) => {
87101 await configPy . extendContext ! ( {
88102 securityContext : { sub : '1234567890' , iat : 1516239022 , user_id : 42 }
89103 } ) ;
90104 } ,
91105
92- 'extendContext - async version' : async ( ) => {
106+ 'extendContext - async version (sequential) ' : async ( ) => {
93107 await configAsyncPy . extendContext ! ( {
94108 securityContext : { sub : '1234567890' , iat : 1516239022 , user_id : 42 }
95109 } ) ;
@@ -100,7 +114,7 @@ describe('Python Configuration Loading', () => {
100114 await configPy . queryRewrite ! ( testQuery , { } ) ;
101115 } ,
102116
103- 'queryRewrite - async version' : async ( ) => {
117+ 'queryRewrite - async version (sequential) ' : async ( ) => {
104118 const testQuery = { str : 'string' , int_number : 1 , bool_true : true } ;
105119 await configAsyncPy . queryRewrite ! ( testQuery , { } ) ;
106120 } ,
0 commit comments