File tree 2 files changed +17
-5
lines changed
2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -75,6 +75,13 @@ async function bench() {
75
75
} , s => {
76
76
s . replace ( / r e p l a c e m e n t / g, 'replacement\nReplacement' ) ;
77
77
} ) ;
78
+
79
+ const size = 1000000 ;
80
+ runWithInstance ( 'overwrite' , [ 'a' . repeat ( size ) ] , s => {
81
+ for ( let i = 1 ; i < size ; i += 2 ) {
82
+ s . overwrite ( i , i + 1 , 'b' ) ;
83
+ }
84
+ } ) ;
78
85
}
79
86
80
87
bench ( ) ;
Original file line number Diff line number Diff line change @@ -11,11 +11,16 @@ export default class Chunk {
11
11
this . storeName = false ;
12
12
this . edited = false ;
13
13
14
- // we make these non-enumerable, for sanity while debugging
15
- Object . defineProperties ( this , {
16
- previous : { writable : true , value : null } ,
17
- next : { writable : true , value : null } ,
18
- } ) ;
14
+ if ( DEBUG ) {
15
+ // we make these non-enumerable, for sanity while debugging
16
+ Object . defineProperties ( this , {
17
+ previous : { writable : true , value : null } ,
18
+ next : { writable : true , value : null } ,
19
+ } ) ;
20
+ } else {
21
+ this . previous = null ;
22
+ this . next = null ;
23
+ }
19
24
}
20
25
21
26
appendLeft ( content ) {
You can’t perform that action at this time.
0 commit comments