Results 1 to 2 of 2
  1. #1
    2potatocakes is offline Member
    Join Date
    Sep 2008
    Posts
    43
    Rep Power
    0

    Default what's the fastest method of storing and retrieving large amounts of data in Java?

    Hi guys,

    Have been speed testing new algorithms on my computer searching for very large primes however part of one of my new methods uses the 'FileReader' from java to go into a .txt file and read each line individually into my program before it turns it into an integer and is processed. However this seems to slow down my program quite a LOT

    What I'm wondering is: What are some of the alternative methods for storing data and being able to quickly retrieve the information stored. The speed on storing it is not important as the values I am storing are fixed and won't be changed. But I need to access it as quickly as possible! Every microsecond counts ;)

    Has anyone got any suggestions?

    Kind Regards,

    Lucas

  2. #2
    Paul Richards is offline Member
    Join Date
    Oct 2008
    Location
    UK
    Posts
    65
    Rep Power
    0

    Default

    have you tried using a BufferedReader ?

    Alternatively, if you can keep your values in memory that will be a LOT faster than file access.

Similar Threads

  1. error while retrieving data from data base
    By kirtesh4u in forum New To Java
    Replies: 5
    Last Post: 11-15-2008, 05:10 PM
  2. parsing/storing large text data
    By hkansal in forum New To Java
    Replies: 4
    Last Post: 10-19-2008, 07:34 PM
  3. storing and retrieving a file as such
    By anil_manu in forum Advanced Java
    Replies: 0
    Last Post: 03-11-2008, 02:27 PM
  4. Retrieving data from the DB
    By yuchuang in forum JDBC
    Replies: 2
    Last Post: 11-27-2007, 09:59 AM
  5. Problem with storing and retrieving from a textfile
    By Albert in forum Advanced Java
    Replies: 1
    Last Post: 07-13-2007, 04:01 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •