Quantcast C_Map.GetPlayerMapPosition Memory Usage - Page 2 - WoWInterface
Thread Tools Display Modes
07-09-18, 01:53 AM   #21
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 892
This is curiosity, not a "gang-up".

Unless there is some significant optimisation (happy to be educated), even incremental GC will be called more often as there is more G being produced to C.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.

Last edited by Fizzlemizz : 07-09-18 at 01:59 AM.
  Reply With Quote
07-09-18, 03:12 PM   #22
dssd
A Fallenroot Satyr
Join Date: May 2016
Posts: 22
GC time is proportionate to the complexity of the garbage. These are incredibly simple tables.
  Reply With Quote
07-09-18, 06:49 PM   #23
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 892
Which begs the question, why use a table in a language that allows multiple returns?

I feel like I must be missing some simple point, which wouldn't be the first time .
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
07-09-18, 07:02 PM   #24
dssd
A Fallenroot Satyr
Join Date: May 2016
Posts: 22
I'd guess it's towards normalization of data. For instance, look at C_Map.GetMapLinksForMap, it returns the same 2D vector table but as a field of a subtable in a collection of tables. In that case, multiple returns don't help, but containing them in a table keeps the data consistent. Vector 2D is likely the most contentious given that it is just two fields, but it scales better the more fields the type contains.
  Reply With Quote
07-09-18, 09:01 PM   #25
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 892
I remain to be convinced that it's normalisation .
Code:
local left, right, top, bottom = C_Map.GetMapRectOnMap(childMapInfo.mapID, mapID)
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote
Today, 05:43 AM   #26
Simca
An Aku'mai Servant
 
Simca's Avatar
AddOn Author - Click to view addons
Join Date: Jan 2012
Posts: 32
This issue has come up a lot in #wowuidev over the last several months. There is a WoW UI dev in there who kindly answers most of our questions and takes note of issues.

A lot of different people have argued this point with him, and I think I can quickly summarize his two main arguments for those curious:
  • They've greatly improved garbage collection performance recently, and have monitored the performance involved in using tons of small, disposable tables under the new GC implementation. It is an incredibly small performance hit.
  • Tables help normalize UI implementation and are especially useful in cases where the number of returns is variable. The other thing seems to be preference. It seems like the UI devs prefer the syntax where you pull down a table of results and use the individual parts you need rather than doing 'local _, _, thingA, _, _, _, _, thingB = SomeRandomApi()'.

I'm just paraphrasing here, but this is what I recall. In any case, it seemed like an issue they were -not- willing to budge on. One person was very adamant that they should introduce a function to return this one argument he was interested in because he polled it very frequently and was now required to pull down a table (Spell name, maybe? I forget), and the UI dev was not willing to entertain the possibility of introducing specialized functions to bypass the table returns. He was fairly adamant that there would be a near zero performance impact due to the speed of simple table disposal.

The only annoying part here is that it is basically impossible for us to independently verify their claims because as noted in previous posts, you can't really perform a partial GC on demand and record cycles spent or reliably compare the results. The only ones who can really know the exact impact of these changes are Blizzard themselves.
__________________
Assistant admin for MMO-Champion
WoW database file expert - ask me anything
  Reply With Quote
Today, 07:15 AM   #27
Kanegasi
A Cobalt Mageweaver
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 230
Originally Posted by Simca View Post
It seems like the UI devs prefer the syntax where you pull down a table of results and use the individual parts you need rather than doing 'local _, _, thingA, _, _, _, _, thingB = SomeRandomApi()'.
I can actually agree with this part. I have used a table to get function returns before, but it was a reusable table in a custom pool function. I have always not liked using an underscore as a universal dump variable. It has caused many minor issues over the course of addon development over the years. The wall of shame link in my signature exposes why itís an issue.

However, relying on supposed efficiency to excuse inefficiency isnít a great coding practice. Itís like tossing bottles at a campsite because the park youíre at has a world class janitor army. Thatís still littering.
  Reply With Quote
Today, 11:44 AM   #28
JDoubleU00
A Rage Talon Dragon Guard
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 333
Originally Posted by Kanegasi View Post
However, relying on supposed efficiency to excuse inefficiency isnít a great coding practice. Itís like tossing bottles at a campsite because the park youíre at has a world class janitor army. Thatís still littering.
Great analogy!
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
Today, 12:16 PM   #29
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 892
Originally Posted by Simca View Post
[*]They've greatly improved garbage collection performance recently, and have monitored the performance involved in using tons of small, disposable tables under the new GC implementation. It is an incredibly small performance hit.
Did they define "tons" or give a timeframe in which "tons" were created/disposed? This is an API for public consumption and test lab or even Blizzard UI conditions rarely mimic all the real world uses.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle and Move Pad Plus.
  Reply With Quote

WoWInterface » PTR » PTR API and Graphics Changes » C_Map.GetPlayerMapPosition Memory Usage

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off