Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix snow.platform.web.utils.ByteArray resizing #68

Closed
wants to merge 1 commit into from

Conversation

restorer
Copy link

@restorer restorer commented Mar 4, 2015

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.

@ruby0x1
Copy link
Member

ruby0x1 commented Mar 4, 2015

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!

http://snowkit.org/2015/03/01/snowkit-dev-log-1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants