Personally I'm not aware of a benchmark yielding concrete comparison numbers. However this questions extends to Scala's anonymous class files generation and surprisingly Scala's performance is unbelievably close to Java's. JIT compilers really do their job. Now comparing Record fields which are Scala objects the access to those is quite fast perhaps not as fast as regular fields access but I wouldn't be worried about that at all. Because we're talking about persistence the time spent with datastore conversations exceeds by far the time of accessing fields. I would expect very little differences ... but again I don't have concrete numbers. The memory consumption is a little higher of course but again I wouldn't be worried to much about this as Record's fields are typically very thin.
We also thought making record to use annotated vars but this is more restrictive besides we can not have Scala annotations with retention policy RUNTIME ... which would make us use Java annotation :( Br's, Marius On Apr 12, 1:39 pm, Giuseppe Fogliazza <[email protected]> wrote: > I have been surprised looking at how Mapper and Record frameworks use > object of anonymous classes extending (Mapped)Field to represent > attributes. This provide a powerful mechanisms to incorporate in Field > traits and classes, services for persistency and representation. Based > on this I am trying to subclass Record in order to implement > persistency using XML files and keeping complex models (models with > many connection between different objects) in memory. I made previous > experience in designing such a service trying to avoid the use of > reflection for efficiency reasons, but I finished with a generative > approach, I am not completely satisfied (different tools for model > design and code generation). Here it comes Scala and its brilliant use > in Lift, opening up new opportunities. Nevertheless before going on I > am concerned about implementation effciency and specifically about > memory consumption, in comparison to a more conservative approach in > representing attributes as simple var or val. As far as I understood > the pattern lead to many anonymous classes, each representing a field > in a record. What is the impact of this approach on memory > consumption? Is field access time negatively affected? > Thanks for suggestions on this topic. > > Regards > beppe --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/liftweb?hl=en -~----------~----~----~----~------~----~------~--~---
