Thank you all for your help.
There is a slight improvement, but unfortunately I was hoping for something faster.
So at this point I think I have to change the structure of xdata or take another road.
Right now I am thinking of the following solution:
1. Rewrite the application to use a new structure of xdata, allowing higher speed when creating selection sets
2. After starting the application, if a user opens a DWG file that contains the old structure of xdata, starts a function that converts it like new.
As I need to save for each object, of different values accompanied by a label, which xdata structure do you recommend for making quick creation of groups of selection, filtering objects by layer, color, object type, one or more label of xdata.
I accept any advice or idea or different approach.