• Post Reply Bookmark Topic Watch Topic
  • New Topic

performance issue while creating object  RSS feed

 
indrakolkata saha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to populate tranfer object i.e value object in DAO.
I can do it two ways ,through constructor ,or through setter method.
In Performance and memory use wise which is better approach in populating value object,using construtor or using setter method.
Thanks In advance
 
indrakolkata saha
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any one have any idea on it
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Any difference is likely to be trivial, small enough to ignore. But if you needed to create a million objects in a nanosecond, and every bytecode counted, I'd go with the constructor, as you'd be able to avoid making a whole bunch of extra method calls.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!