• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Least efficient way to load the data to memory

 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Team,

Below is my sample data:




Question 1: What would be the least efficient way to load the above data to memory?
Question 2: Assume if i have 1000 rows of the above table structure, how do we estimate the approx. memory size of the data structure?


 
Marshal
Posts: 79979
397
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Do you really mean least efficient?
That looks like really horrible design, unless you are inserting those data into a database. Create a class which encapsulates those 5 data. You can work out the sizes of the two primitives easily enough. Strings vary depending on their size. Add a few dozen bytes to create the objects and multiply by 1000.
Which is a waste of time, because even the smallest modern computer will have enough RAM to fit 1000000 objects like that it.

By the way: there is a way to make such tables show up nicely: code tags.
 
The overall mission is to change the world. When you've done that, then you can read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic