Skip to content

Line of code takes 12 seconds off runtime.#2

Open
ahitt6345 wants to merge 2 commits intobellbind:masterfrom
ahitt6345:patch-1
Open

Line of code takes 12 seconds off runtime.#2
ahitt6345 wants to merge 2 commits intobellbind:masterfrom
ahitt6345:patch-1

Conversation

@ahitt6345
Copy link

Apparently, this tim sort keeps merging uneven runs. Adding this code makes sure it prioritizes Even Runs. I ran this timsort(before edit) on 1000000 Integers in a random order. It took a whopping 12 SECONDS vs. The normal merge sort's 2 seconds. Now, it's run time is improved to 0.9 seconds.

Apparently, this tim sort keeps merging uneven runs. Adding this code makes sure it prioritizes Even Runs. I ran this timsort(before edit) on 1000000 Integers. It took a whopping 12 SECONDS vs. The normal merge sort's 0.5 seconds.  Now, it's run time is improved to 0.9 seconds.
@bellbind
Copy link
Owner

I want to apply it, but the project as the document code, it should not applied the last code only.

@ahitt6345
Copy link
Author

Then you should apply the code to all the documents that use the stack.

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