Skip to content
This repository has been archived by the owner on May 26, 2018. It is now read-only.

Small simplification and optimization in tick start/end #148

Merged
merged 1 commit into from
Mar 10, 2013

Conversation

Uristqwerty
Copy link
Contributor

Change the EnumSet equivalent of "A &= ~ new(~B)" to "A &= B".
This eliminates the need for one temporary object and one static method invocation in a frequently called loop.

Further optimization is possible, but would not necessarily simplify the code, so is not included in this pull request.

Change the EnumSet equivalent of "A &= ~ new(~B)" to "A &= B".
This eliminates the need for one temporary object in a frequently called loop, and reduces the number of methods that need to be invoked.
@cpw
Copy link
Contributor

cpw commented Jan 8, 2013

Interesting change. Have you tested it? I am reluctant to futz with ticking code unnecessarily.

@LunNova
Copy link

LunNova commented Jan 27, 2013

I've had this patch running on a large server and apparently working fine for about a month - not that that's very good evidence that it's correct, of course.

@cpw
Copy link
Contributor

cpw commented Jan 28, 2013

Yeah, given the ticking code generally hits modloader mods much harder, I would want observations from modloader mod users.. (Therefore, client mods, generally)

@cpw
Copy link
Contributor

cpw commented Feb 26, 2013

Do we have any data on this?

@AartBluestoke
Copy link

sampling wise, i've mostly got ssp (and some smp)data. It is an insignificant amount of cpu spent here - complementOf rounds to 0.00%, and remove all doesn't appear on the list at all.

I agree with the change though - simplifying logic, and having less mem turnover is always a bonus, unless the jvm is optimizing the intermediate object away anyway....

@cpw
Copy link
Contributor

cpw commented Feb 26, 2013

OK. I'll pull it into the 1.5 snapshot..

@cpw cpw merged commit 179c504 into MinecraftForge:master Mar 10, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants