-
Notifications
You must be signed in to change notification settings - Fork 125
Speeds up lists massively #2418
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
Conversation
amylizzle
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/proc/RunTest()
var/list/L = list()
for(var/i in 1 to 5)
L.Add("[i]")
L["[i]"] = "item [i]"
ASSERT(length(L) == 5)
ASSERT(L["3"] == "item 3")
should give {"1":"item 1","2":"item 2","3":"item 3","4":"item 4","5":"item 5"} instead gives {"1":"item 1","1":"item 1","2":"item 2","2":"item 2","3":"item 3","3":"item 3","4":"item 4","4":"item 4","5":"item 5","5":"item 5"}
I just found this out; I got another idea that should be pretty similar though when I get done coding it |
|
Im going to close this for now until I figure this out |
Added assertions to validate list behavior and contents.
…into ListSpeedup
|
Should be good to rereview now |
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Partial fix for: #2367
This is alot faster; went from 2.1 minutes with the code in the issue to ~490ms
I'm fairly certain this won't break anything because its just checking if the key exists and instead of manually searching the dictionary I just uses the dictionary search function thats faster (O(n) instead of O(n^2))