Skip to content

Conversation

@redmoogle
Copy link
Contributor

@redmoogle redmoogle commented Oct 14, 2025

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))

@boring-cyborg boring-cyborg bot added the Runtime Involves the OpenDream server/runtime label Oct 14, 2025
@github-actions github-actions bot added size/S and removed size/XS labels Oct 15, 2025
Copy link
Collaborator

@amylizzle amylizzle left a 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"}

@redmoogle
Copy link
Contributor Author

/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

@redmoogle
Copy link
Contributor Author

Im going to close this for now until I figure this out

@redmoogle redmoogle closed this Oct 15, 2025
@redmoogle redmoogle reopened this Oct 15, 2025
@github-actions github-actions bot added size/M and removed size/S labels Oct 15, 2025
@redmoogle
Copy link
Contributor Author

Should be good to rereview now

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Runtime Involves the OpenDream server/runtime size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants