nehtik / epgp

Automatically exported from code.google.com/p/epgp
0 stars 0 forks source link

Stop exporting classes in the export string #433

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Class information is not needed anymore so it makes no sense to keep 
sending it.

Original issue reported on code.google.com by evlogimenos on 7 Jun 2009 at 2:51

GoogleCodeExporter commented 8 years ago
This is fixed in r1236.

Original comment by evlogimenos on 7 Jun 2009 at 2:52

GoogleCodeExporter commented 8 years ago
I was actually using this information in a script of mine (to quickly graph PR 
versus
time, with each class individually selectable so as to not have 60 odd lines on 
the
graph).  Does it really hurt to have it ?

Original comment by suisana...@gmail.com on 9 Jun 2009 at 3:06

GoogleCodeExporter commented 8 years ago
It is more data for the webapp to parse (about 50% more bytes). You can get 
this 
information through saved variables since at logout the addon dumps its current 
state.

Original comment by evlogimenos on 9 Jun 2009 at 4:28

GoogleCodeExporter commented 8 years ago
That smacks of premature optimisation.  Sure it's ~50% more, but even if you 
had a
3000 (to pick a ridiculous number out of the air based on approx. max number of
players logged into a given realm at one time) member guild you'd only be going 
from
~60KB to ~120KB.

Any code struggling to parse the extra is truly badly written.  So now I, and 
anyone
else who was making use of this, has to parse two different sets of data and
reconcile them rather than one nice and simple parse.

I've a mind to fish out the previous version's code and just keep patching mine 
back
to put the class in again.

Original comment by suisana...@gmail.com on 9 Jun 2009 at 12:37

GoogleCodeExporter commented 8 years ago
Premature? By definition of some optimization that happened after the code is 
written it cannot be premature. Sure it breaks you application. But your 
application 
parses one export string per day tops. My application parses at least one 
(close to 
two) orders of magnitude more. 50% for you is peanuts but 50% for me is not :-)

No matter what kind of code parses this stuff, however good it is, it doesn't 
change 
the fact that 50% data is going to take 50% more time to parse. If you want to 
start a 
thread arguing that simplejson sucks, feel free but I won't entertain it. I do 
not really 
care if it sucks either.

As for the data exported, what if tomorrow you decide that you want to see the 
ranks 
as well? Or the races? Or the genders? Or the professions of each of the 
players? The 
hint is, this information is (more or less) static. You can grab it once, 
either from the 
game or the armory or even type it by hand and reuse it. The addon should not 
be 
exporting this data each and every time when it practically never changes.

Original comment by evlogimenos on 9 Jun 2009 at 1:08

GoogleCodeExporter commented 8 years ago
@Evlo - ;)

Original comment by dingochavezz@gmail.com on 9 Jun 2009 at 11:26

GoogleCodeExporter commented 8 years ago
Omitting 2 more bytes in export (if you use 0-9 for class) for each character 
saves 
50 % of parse time?

Actually you could save additional parsing time by attaching some unique and 
short 
identifier to each character and next export you can just export only the id 
and not 
the whole charname.

Also you can convert numbers to hexadecimal or some more scaled number, it 
would save 
you more bytes in parsing.

And I would suggest to use dot '.' instead of comma ',' as a value separator 
because 
some ppl say that even if it is still the same byte size, dot is smaller than 
comma. 
I can't say so, but you can try it, there's nothing to loose

I think you can go to 10 % of the current parsing time if you implement what I 
suggested.

I also wanted to say that your epgpweb.com site has really beautiful design 
which 
fits to look of my guild's web site and also the ads there do not annoy anyone. 
So I 
honestly welcome the optimization for that wonderful advertisement web.

Whatever, thanks for the addon.

Original comment by tomas.klapka on 11 Jun 2009 at 9:36

GoogleCodeExporter commented 8 years ago
You are free not to use the free services of epgpweb :-)

Thank you for your very informative first contribution to epgp. It is much 
appreciated. 
Noone would have ever thought you would find such a genius contributing this 
extremely valuable feedback.

Original comment by evlogimenos on 11 Jun 2009 at 12:24

GoogleCodeExporter commented 8 years ago
sorry, I was kind of mean :) but still I don't find omitting class information 
in
exports at all to be any significant optimization in parsing.

well, hopefully last word from me on this topic then: There might be a 
compromise...
There could be a setting which would be turned off by default. If you turn it 
on it
would export class information as well with something like "export_class":1 so
everyone can distinguish between exports with class and exports without class.
In your webapp you can accept only exports without class.

I know that if this would be an issue it would have a very low priority but I 
just
wanted to share the idea. I am going to solve this issue for myself by any way 
anyway
but other ppl might welcome this backward compatibility option.

Original comment by tomas.klapka on 16 Jun 2009 at 11:54

GoogleCodeExporter commented 8 years ago
@klapka = what adds? I have no adds when I view the epgpweb.com site. Rest of 
it -
Evlogimenos has been working on this addon for a long time, and everythig you 
are
saying is J.A.D. If you don'tlike the free service then get all the guild 
members to
install the addon and they can see it in game.

Original comment by dingochavezz@gmail.com on 16 Jun 2009 at 3:51

GoogleCodeExporter commented 8 years ago
@dingochavezz:

'Ads' as 'Google Ads' as advertisement.

Sorry, I don't know what term "J.A.D." mean.

I appreciate what has Evlogimenos done. It is really nice addon. I just don't 
agree
with the optimization argument. I just don't buy it so I was acting mad, sorry 
about
that.

The point is that I made a parser of the exported data for our guild site, so 
we have
kind of local equivalent of EPGPWeb working (with guild site look and without
advertisement) and everyone got used to class colors. Now I and other people 
who was
using class information in export have to get the class information from another
source or tweak addon's code.

Original comment by tomas.klapka on 16 Jun 2009 at 4:18

GoogleCodeExporter commented 8 years ago
for those who miss character's class information in exports like me there is a 
easy 
hack of epgp addon which reverts the change.

In epgp.lua find this line (is in EPGP:ExportRoster() function):
table.insert(t, {name, ep, gp})

and replace it by this line:
table.insert(t, {name, self:GetClass(name), ep, gp})

Original comment by tomas.klapka on 22 Jun 2009 at 11:21

GoogleCodeExporter commented 8 years ago
I made a version which has a configurable option to enable/disable class 
information 
in exports.

Not much code change, just added a new module 'export.lua' for a new tab at 
'/epgp 
config' Added some localization (enUS added only at the moment) for the config 
UI.
In epgp.lua I've added the actual class export as an option and also I've added 
a 
function used to change the setting.

Original comment by tomas.klapka on 3 Jul 2009 at 10:03

Attachments: