Renew wrote:this doesnt work - the DKP values are stored in the guild notes...and they can change each boss

If it's an addOn that updates the DKP after each boss kill, then the solution here is to update your guildTable as well. You don't need to update all your guildTable (i.e. check offline players), instead you just update your raid members that are guild members too.
Renew wrote:basically youre right, i could save names and DKP in a table and loop the 1. table with all rollers (less loops)
but in the end it would be more effort, because i have to loop and save the guildinfos before

The guild infos are just stored in the beginning or updated when you kill a boss, like I said above. Storing/reading values in local variables is way faster than calling functions, for example:
GetGuildRosterInfo.
It all leads to memory space vs cpu time. You can save all your guild info in a table to quickly access after (downside: wasting 2 or 3 KBytes) or you can call 200 times the functions GetGuildRosterInfo + GetNumGuildMembers everytime you kill a boss (downside: takes more cpu time).
Example:
1) You join a raid -
creates a table with guildmates2) Your raid killed a boss -
DKP AddOn updates values3)
RollAddOn checks if there are guild members in your raid (max: 40 [i]ifs), if yes stores new values in the guildTable.[/i]
4) You start a roll -
saving all player rolls (let's say 10 people rolled)5)
RollAddOn checks if players that rolled are in your guild (+10 [i]ifs)[/i]
6) Done.
For this case, you did 50
ifs.
In the end, the worst case scenario is 80
ifs per boss kill (i.e. you are in a 40man raid and everyone rolled). Way better than your first solution: 2000
ifs and your other solution 200
ifs.
For further information, I recommend using GetTime() to see how much time these 3 solutions take to do the job.