HashingProblem

Discussion in 'Plugin Development' started by IDragonfire, Dec 3, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    IDragonfire

    Hi,
    I have the following problem:

    I use a HashMap<DKey, DValue> to store imformation and reduce the database/configuration traffic.

    DKey and DValues are my own classes.

    I need my own classes, because sometimes a key is a combination of fields and I need the informations of the fields later.
    Each time a special item is needed I create a DKey object.
    I choose these way, because a String creation take to much time and also a split on the String.

    These way is also not efficent, because I must create each time a new DKey object ...

    If I want to store the keys, I have the same problem^^
    My solution is to generate my own hash out of the key fields (and store them in a new HashMap<String or Integer, DKey>) to get created DKey objects and reduce the creation of new DKey objects. But also here we create a object every time we want to load something :-( (String or new Integer(hashcodeOfFields))

    Has anyone a better solution?
     
Thread Status:
Not open for further replies.

Share This Page