--
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")
---
You received this message because you are subscribed to the Google Groups "guava-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guava-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/guava-discuss/bf68f14f-d684-4ba9-89c8-e6afac91324a%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")
--- You received this message because you are subscribed to the Google Groups "guava-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guava-discuss+unsubscribe@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/guava-discuss/52685B12.5090009%40orcaware.com.
Right, but how much? People may be willing to take a Optional construction if its 10x cheaper than constructing and throwing an exception.
Guava is outspokenly anti-null. Optional seems to underscore that point. The existence of Optional implies that Guava (or at least one rogue functional programmer with commit access to Guava) thinks that....
Optional.absent())null (though there are several other approaches to this that should be considered first)On Wednesday, October 23, 2013 5:34:47 PM UTC-7, Martin Grajcar wrote:On Thu, Oct 24, 2013 at 1:58 AM, Blair Zajac <bl...@orcaware.com> wrote:Right, but how much? People may be willing to take a Optional construction if its 10x cheaper than constructing and throwing an exception.With respect to memory, I'd say that it's about twice as expensive as using nullable Integer since you need two small objects instead of one. With respect to time, it's a bimorphic virtual call vs. null check, so again at least a factor of two (but probably negligible when compared to the parsing). In case the parsing failed, it's memory-wise one object to zero.I guess Optional is more 10x cheaper than the exception. However, there might be people wanting the maximum speed possible.
--
--
guava-...@googlegroups.com
Project site: http://guava-libraries.googlecode.com
This group: http://groups.google.com/group/guava-discuss
This list is for general discussion.
To report an issue: http://code.google.com/p/guava-libraries/issues/entry
To get help: http://stackoverflow.com/questions/ask (use the tag "guava")
---
You received this message because you are subscribed to the Google Groups "guava-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to guava-discus...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/guava-discuss/a0eb2ab7-6af0-41af-92f1-a97796bd931e%40googlegroups.com.