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

Profiling based improvements #1115

Merged
merged 11 commits into from
Dec 3, 2018
Merged

Profiling based improvements #1115

merged 11 commits into from
Dec 3, 2018

Conversation

Mag-nus
Copy link
Member

@Mag-nus Mag-nus commented Dec 3, 2018

Removed the last reflection based skill lookups. Now all skill lookups go through the portal.dat
This reduces CPU demand by about 2% or more.

Removed the legacy attributes for Skill/PropertyAttribute2nd. These were to allow us to define these enum values with meta data before when we weren't loading the data from the portal.dat. Now that the data comes from the portal.dat, we do not need these. They are being removed to avoid confusion.

Removed the PhysicsObj != null check for the Landblock.GetPhysicsWorldObjects().
This reduces CPU demand by about 6%.

@@ -1315,7 +1315,7 @@ public static void HandleShowStats(Session session, params string[] parameters)
var specialized = player.Skills.Values.Where(s => s.AdvancementClass == SkillAdvancementClass.Specialized).OrderBy(s => s.Skill.ToString());
var trained = player.Skills.Values.Where(s => s.AdvancementClass == SkillAdvancementClass.Trained).OrderBy(s => s.Skill.ToString());
var untrained = player.Skills.Values.Where(s => s.AdvancementClass == SkillAdvancementClass.Untrained).OrderBy(s => s.Skill.ToString());
var unusable = player.Skills.Values.Where(s => s.AdvancementClass == SkillAdvancementClass.Inactive).OrderBy(s => s.Skill.ToString());
var inactive = player.Skills.Values.Where(s => s.AdvancementClass == SkillAdvancementClass.Inactive).OrderBy(s => s.Skill.ToString());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be displaying unusable skills

@@ -422,7 +422,7 @@ private static IEnumerable<WorldObject> HandlePhysics(double timeTick)

private static void HandlePhysicsLandblock(Landblock landblock, double timeTick, ConcurrentQueue<WorldObject> movedObjects)
{
foreach (WorldObject wo in landblock.GetPhysicsWorldObjects())
foreach (WorldObject wo in landblock.GetWorldObjectsForPhysicsHandling())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetWorldObjectsForPhysicsHandling() should be removed entirely

this should just be:

foreach (var wo in landblock.WorldObjects.Values), assuming the places that access it have exclusive access

Creating a duplicate list of every WO in every landblock 30-60x per second, vs. just iterating through the existing list of WOs...

@Mag-nus
Copy link
Member Author

Mag-nus commented Dec 3, 2018

Both issues have been addressed.

For the unusable skills, they're still in the untrained state, so they're displayed with that list. They now just have the [Unusable] tag added to the end. They are sorted in the order as they appear in the client.

@gmriggs
Copy link
Collaborator

gmriggs commented Dec 3, 2018

Bow: 0
Mace: 0
Sword: 0
UnarmedCombat: 0

These skills are showing up in Player.Skills as 'untrained', instead of 'inactive'

@Mag-nus Mag-nus merged commit 3e836a6 into ACEmulator:master Dec 3, 2018
@Mag-nus Mag-nus deleted the Profiling branch December 4, 2018 01:42
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.

None yet

2 participants