In my app ByteArray has very slow performance while reading big json file.
I dig into this problem, and found that set_length calls _snowResizeBuffer at every writeByte.
Illustration:
value
allocated
action
-
0
initial
1
1
up resize
2
2
up resize
3
4
up resize
4
4
-
5
8
up resize
6
6
down resize
7
12
up resize
8
8
down resize
9
16
up resize
10
10
down resize
...
...
... etc ...
My proposal is to do down resize if allocated are twice more than required value.
I might not have been properly clear in the dev log, but this class and everything associated with it is being deleted during alpha-2.0 in favour of newer code. Nice catch though!
In my app ByteArray has very slow performance while reading big json file. I dig into this problem, and found that set_length calls _snowResizeBuffer at every writeByte. Illustration:
My proposal is to do down resize if allocated are twice more than required value.