File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -241,10 +241,10 @@ export function decodePage(
241241 return v2Strings as ( string | null ) [ ] ;
242242 }
243243 // Parquet-style: packed non-null values, interleave with nulls
244- const withNulls : ( string | null ) [ ] = [ ] ;
244+ const withNulls = new Array < string | null > ( rowCount ) ;
245245 let vi = 0 ;
246246 for ( let i = 0 ; i < rowCount ; i ++ ) {
247- withNulls . push ( nulls . has ( i ) ? null : ( vi < v2Strings . length ? v2Strings [ vi ++ ] : null ) ) ;
247+ withNulls [ i ] = nulls . has ( i ) ? null : ( vi < v2Strings . length ? v2Strings [ vi ++ ] : null ) ;
248248 }
249249 return withNulls ;
250250 }
@@ -261,10 +261,10 @@ export function decodePage(
261261 return values ;
262262 }
263263 // Parquet-style: packed non-null values, interleave with nulls
264- const withNulls : ( number | bigint | string | null ) [ ] = [ ] ;
264+ const withNulls = new Array < number | bigint | string | null > ( rowCount ) ;
265265 let vi = 0 ;
266266 for ( let i = 0 ; i < rowCount ; i ++ ) {
267- withNulls . push ( nulls . has ( i ) ? null : ( vi < values . length ? values [ vi ++ ] : null ) ) ;
267+ withNulls [ i ] = nulls . has ( i ) ? null : ( vi < values . length ? values [ vi ++ ] : null ) ;
268268 }
269269 return withNulls ;
270270 }
Original file line number Diff line number Diff line change @@ -1142,8 +1142,11 @@ export class SetOperator implements Operator {
11421142 if ( mode !== "union_all" ) this . seen = new Set ( ) ;
11431143 }
11441144
1145+ private cachedKeys : string [ ] | null = null ;
1146+
11451147 private rowKey ( row : Row ) : string {
1146- const keys = Object . keys ( row ) . sort ( ) ;
1148+ if ( ! this . cachedKeys ) this . cachedKeys = Object . keys ( row ) . sort ( ) ;
1149+ const keys = this . cachedKeys ;
11471150 let result = "" ;
11481151 for ( let i = 0 ; i < keys . length ; i ++ ) {
11491152 if ( i > 0 ) result += "\x00" ;
You can’t perform that action at this time.
0 commit comments