File tree 5 files changed +14
-57
lines changed
5 files changed +14
-57
lines changed Original file line number Diff line number Diff line change @@ -155,23 +155,8 @@ function run(): number[] {
155
155
return result ;
156
156
}
157
157
158
- // console.log(`result: ${run()}`);
159
-
160
- // based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs
161
- const total = 10 ;
162
- const runs = 100_000 ;
163
-
164
- let sum = 0 ;
165
- const bench = ( ) => {
166
- const start = performance . now ( ) ;
167
- for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
168
- const elapsed = Math . floor ( performance . now ( ) - start ) ;
169
- const rate = Math . floor ( runs / ( elapsed / 1000 ) ) ;
170
- sum += rate ;
171
- } ;
172
-
173
- for ( let i = 0 ; i < total ; i ++ ) {
174
- bench ( ) ;
175
- }
158
+ const runs = 10_000 ;
159
+ const start = performance . now ( ) ;
160
+ for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
176
161
177
- console . log ( sum / total ) ;
162
+ console . log ( ( ( performance . now ( ) - start ) ) . toFixed ( 10 ) ) ;
Original file line number Diff line number Diff line change @@ -144,21 +144,8 @@ function run(): number[] {
144
144
return result ;
145
145
}
146
146
147
- // console.log(`result: ${run()}`);
148
-
149
- // based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs
150
- const total = 10 ;
151
- const runs = 100_000 ;
152
-
153
- let sum = 0 ;
154
- const bench = ( ) => {
155
- const start = performance . now ( ) ;
156
- for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
157
- const elapsed = Math . floor ( performance . now ( ) - start ) ;
158
- const rate = Math . floor ( runs / ( elapsed / 1000 ) ) ;
159
- sum += rate ;
160
- } ;
161
-
162
- for ( let i = 0 ; i < total ; i ++ ) bench ( ) ;
147
+ const runs = 10_000 ;
148
+ const start = performance . now ( ) ;
149
+ for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
163
150
164
- console . log ( sum / total ) ;
151
+ console . log ( ( ( performance . now ( ) - start ) ) . toFixed ( 10 ) ) ;
Original file line number Diff line number Diff line change @@ -136,23 +136,8 @@ const run = (): number[] => {
136
136
return result ;
137
137
} ;
138
138
139
- // Porffor.print(run()); Porffor.printStatic('\n');
140
-
141
- // based on https://github.com/littledivy/blazing-fast-ffi-talk/blob/main/bench.mjs
142
- const total = 10 ;
143
- const runs = 100_000 ;
144
-
145
- let sum = 0 ;
146
- const bench = ( ) => {
147
- const start = performance . now ( ) ;
148
- for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
149
- const elapsed = Math . floor ( performance . now ( ) - start ) ;
150
- const rate = Math . floor ( runs / ( elapsed / 1000 ) ) ;
151
- sum += rate ;
152
- } ;
153
-
154
- for ( let i = 0 ; i < total ; i ++ ) {
155
- bench ( ) ;
156
- }
139
+ const runs = 10_000 ;
140
+ const start = performance . now ( ) ;
141
+ for ( let i = 0 ; i < runs ; i ++ ) run ( ) ;
157
142
158
- console . log ( sum / total ) ;
143
+ console . log ( ( ( performance . now ( ) - start ) ) . toFixed ( 10 ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " porffor" ,
3
3
"description" : " An ahead-of-time JavaScript compiler" ,
4
- "version" : " 0.56.2 " ,
4
+ "version" : " 0.56.3 " ,
5
5
"author" :
" Oliver Medhurst <[email protected] >" ,
6
6
"license" : " MIT" ,
7
7
"scripts" : {},
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
import fs from 'node:fs' ;
3
- globalThis . version = '0.56.2 ' ;
3
+ globalThis . version = '0.56.3 ' ;
4
4
5
5
// deno compat
6
6
if ( typeof process === 'undefined' && typeof Deno !== 'undefined' ) {
You can’t perform that action at this time.
0 commit comments