Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Improve LinkedList Array initliasier #958

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

Open
pwallrich wants to merge 1 commit into kodecocodes:master
base: master
Choose a base branch
Loading
from pwallrich:fix/linkedListArrayInit

Conversation

Copy link

@pwallrich pwallrich commented Dec 23, 2020
edited
Loading

Checklist

Description

Improves the Linked List initiliaser to not use append for each element.
When using append, it iterates through the whole LinkedList everytime an item is appended.

Init with 10k Items before:

Executed 1 test, with 0 failures (0 unexpected) in 8.394 (8.395) seconds

Init with 10k Items after:

Executed 1 test, with 0 failures (0 unexpected) in 0.083 (0.084) seconds

Only issue I found, is that the Test crashes with a Bad Access, when using 100k items. I stopped testing if that happens with the old implementation after 50k though, because it already took a couple of minutes to get to 50k and it gets slower, the more items are added. I used the implementation with > 1.000.000 items without problems though

I didn't change the arrayLiteral initialiser, because I don't see anyone, typing that many numbers :)

weitieda and TytsMan reacted with thumbs up emoji
Copy link

Well done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /