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

Larry said there's a way to speed this up #1

Open
robbyblum opened this issue Jul 12, 2019 · 6 comments
Open

Larry said there's a way to speed this up #1

robbyblum opened this issue Jul 12, 2019 · 6 comments

Comments

@robbyblum
Copy link

function RandomAccessGSList(gslist) {

I will never let you forget anything

@larryfenn
Copy link
Member

we don't need to fill the array up more than the result of GSRandRange. should cut memory usage (and probably run time) in half in the average case.

@robbyblum
Copy link
Author

Iterating over the GSList entries has a deterministic order, right?

@larryfenn
Copy link
Member

Yes, provided there is no other operation going on to GSList. There may be a race condition if elsewhere in the program GSList is being resorted.

@robbyblum
Copy link
Author

Mmm, good to know. I imagine that would matter more for scripts that run during gameplay than for the industry constructor.

@larryfenn
Copy link
Member

It should be stated that the current implementation is also potentially faulty to a race condition

@larryfenn
Copy link
Member

While I have not sped this up I realized this was itself a way better implementation of random access than what I had in the industry placer.

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

No branches or pull requests

2 participants