I don't think there's a case for demand to merit having a
repeat(CharSequence, int) at all.
I did an analysis of usages of Guava's Strings.repeat on Google's
codebase. Users might be rolling their own implementations, too, but this
should be a very good proxy for demand.
StringRepeat_SingleConst
I disagree, actually. Collections with size zero and one are significantly
more common than bigger collections.
In Guava's immutable collection factories (ImmutableList.of(...) etc.), we
observed a roughly exponential decline in the number of users of factory
methods of each size: if N people cre
I haven't followed this much, but an observation: in Guava, we avoided
creating lots of specialized implementations for small collections, because
the JVM, at least at the time, had a sweet spot for bimorphic dispatch:
method calls where the real implementation would be one of two options, and
that
You should absolutely not assume parallel streams are faster than
sequential streams.
http://gee.cs.oswego.edu/dl/html/StreamParallelGuidance.html is pretty much
the iconic document on that subject, and explains circumstances under which
parallelism is good, and when it is likely to be harmful.
On
Some iterators might be. Many may not be. Certainly Iterator as an
interface has been out there for long enough there are Iterator
implementations out there that aren't cloneable -- say, Iterators reading
from a BufferedReader, where there really won't be any way to do what
you're hoping for; Buf
Where is the current commitment to unspecified iteration order? Is that in
Java 9?
Generally speaking, I see no problem with going from unspecified to
specified iteration order; if code had to be able to deal with *any* order
previously they can certainly deal with an order that happens to be the
Guava's tests check the explicit definition of square root (mentioned by
Joe above) on 2^n +/- 1 for all n up to Double.MAX_EXPONENT + 1, because
why not?
On Wed, Dec 9, 2015 at 6:12 PM Joseph D. Darcy wrote:
> Hi Brian,
>
> New version looks good.
>
> One more case to try: start with a BigInteg
I'm unclear on whether the question is where Guava stopped, or why we
included the fixed-args versions as well as the varargs versions?
Part of the answer, of course, is that those factories predate
@SafeVarargs, and frankly even now Guava doesn't really depend on Java 7.
If you're asking about w
lues less than Double.MAX_VALUE but this is a first stab at the
> implementation so hopefully such improvement may be brought in later if it
> is not in the first pass.
>
> Thanks,
>
> Brian
>
> On Oct 2, 2015, at 1:54 PM, Louis Wasserman wrote:
>
> > Have you investigat
Have you investigated Guava's really quite tightly optimized implementation
here?
https://github.com/google/guava/blob/master/guava/src/com/google/common/math/BigIntegerMath.java#L242
A few years back I submitted a patch (now applied) to make
BigInteger.doubleValue() very fast. If I recall corre
Just checking -- IIRC, this will change the semantics of how structural
modifications to a subList of a subList will affect the first subList. For
example, I believe in the past, removing an element from a subList of a
subList would decrease the size of the first subList by 1, but now the
first su
to be safe, this would
> have to be a special kind of StringBuilder. Like the following:
>
>
> http://cr.openjdk.java.net/~plevart/misc/ThreadLocalStringBuilder/webrev.01/
>
> Such class would be useful for direct API use too.
>
>
> Regards, Peter
>
>
> On 03/13/201
's codebase for what usages of Guava's Optional look like, in terms
of how often
if (optional.isPresent()) {
...
} else {
...
}
occurs, relative to
if (optional.isPresent()) {
...
}
// no else
On Thu Feb 12 2015 at 10:15:45 AM Paul Sandoz
wrote:
>
> On Feb 12, 2015, at 7:
2:17, Ulf Zibis wrote:
>>>>>
>>>>> I mean:
>>>>>> It does not output byte code that only uses a single char array to
>>>>>> compose the entire String in question.
>>>>>> With "optimization fails", I also mean, there is used an additional
>>>>>> "StringComposer" e.g. another StringBuilder or a StringJoiner in addition
>>>>>> to the 1st StringBuilder.
>>>>>>
>>>>>> -Ulf
>>>>>>
>>>>>> Am 27.08.2014 um 14:02 schrieb Pavel Rappo:
>>>>>>
>>>>>>> Could you please explain what you mean by "javac optimization fails"
>>>>>>> here?
>>>>>>>
>>>>>>> -Pavel
>>>>>>>
>>>>>>> On 27 Aug 2014, at 10:41, Ulf Zibis wrote:
>>>>>>>
>>>>>>> 4.) Now we see, that javac optimization fails again if
>>>>>>>> StringBuilder, concatenation, toString(), append(String),
>>>>>>>> append(Collection) etc. and StringJoiner use is mixed.
>>>>>>>>
>>>>>>>
>
--
Louis Wasserman
e from which the sub-sequence is
> + * derived.
> + * @param startInclusive The index of the character in the source
> character
> + * sequence which will be the first character in the sub-sequence.
> + * @param endExclusive A supplier which returns the index after the
> last the
> + * character in the source character sequence which will be the last
> + * character in the sub-sequence
> + * @return the character sub-sequence.
> + * @since 1.9
> + */
> +static CharSequence subSequenceView(CharSequence source, int
> startInclusive, IntSupplier endExclusive) {
> +return new CharSubSequenceView(source, startInclusive,
> endExclusive);
> +}
> }
>
>
--
Louis Wasserman
What does new BigDecimal(1.035).toString() print? I suspect your issue is
related to the fact that 1.035 is not, in fact, the value represented as a
double; new DecimalFormat("0.00").format(1.035) formats the closest value
representable as a double to the exact value 1.035.
Louis
I don't follow. It looks like ArrayList is throwing an exception on
removeAll(null) -- perfectly valid, in the spec -- not throwing an
exception when the collection contains null.
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
On Tue, Feb 4, 2014 at
On Tue, Apr 2, 2013 at 3:36 PM, Louis Wasserman wrote:
> I would be deeply suspicious of benchmarks that naive, especially for
> benchmarks like this that involve lots of allocation -- you're most likely
> benchmarking the GC, not the actual operation.
>
Sorry, let me clarify:
ows a little performance gain - approximately 9%.
>> I understand it may not be there for all cases, but at least for
>> some cases it is there.
>>
>>
>
--
Louis Wasserman
s native System.arraycopy(), which is probably faster than
>> copying elements in the loop.
>>
>> Sincerely yours,
>> Ivan
>>
>> __**_
>> Concurrency-interest mailing list
>> Concurrency-interest@cs.**oswego.edu
>>
>> <mailto:Concurrency-interest@**cs.oswego.edu
>> >
>>
>> http://cs.oswego.edu/mailman/**listinfo/concurrency-interest<http://cs.oswego.edu/mailman/listinfo/concurrency-interest>
>>
>>
>>
>
--
Louis Wasserman
LANG LANGUAGE GDM_LANG; locale)
> > LANG=
> > LANGUAGE=
> > LC_CTYPE="POSIX"
> > LC_NUMERIC="POSIX"
> > LC_TIME="POSIX"
> > LC_COLLATE="POSIX"
> > LC_MONETARY="POSIX"
> > LC_MESSAGES="POSIX"
> > LC_PAPER="POSIX"
> > LC_NAME="POSIX"
> > LC_ADDRESS="POSIX"
> > LC_TELEPHONE="POSIX"
> > LC_MEASUREMENT="POSIX"
> > LC_IDENTIFICATION="POSIX"
> > LC_ALL=
> >
> >
> > On Mon, Mar 18, 2013 at 11:09 AM, Helio Frota >wrote:
> >
> >>
> >> I would suggest taking en_US.UTF-8 as default when the LANG variable is
> >> not
> >> set to avoid problems with encoding.
> >>
> >
>
>
> --
> Helio Frota
> http://www.heliofrota.com/
>
--
Louis Wasserman
alize this will get a good
> workout once the streams work come in.
>
> Now added.
>
> Thanks!
--
Louis Wasserman
aware of all the
> linkages.
>
> I am actually also wondering whether the patch for 7032154 "Performance
> tuning of sun.misc.FloatingDecimal/FormattedFloatingDecimal," which I just
> learned of today, should perhaps be dealt with prior to any of the above?
>
> Thanks,
>
> Brian
>
--
Louis Wasserman
has to
> precede that for 7131192 if the latter is deemed correct.
>
> B.
>
--
Louis Wasserman
head of my queue. Given
> that I still have a ways to go to get up to speed on this entire topic area
> and code base, I would hesitate to give a date estimate just yet.
> >
> > Brian
> >
> >> Any update on when this could get reviewed?
> >>
> >>
&g
Any update on when this could get reviewed?
On Thu, Dec 13, 2012 at 3:36 PM, Louis Wasserman wrote:
> Hi,
>
> I'm working at Google now, but I'd like to revive this patch as a
> contribution from Google. At the moment, what's mainly needed is review
> for http://b
subnormal uses
> // E_min -1).
> -answer.append("p" + (subnormal ?
> - DoubleConsts.MIN_EXPONENT:
> - Math.getExponent(d) ));
> +answer.append(subnormal ?
> + DoubleConsts.MIN_EXPONENT:
> + Math.getExponent(d));
> }
> return answer.toString();
> }
>
>
--
Louis Wasserman
pal Member of Technical Staff | +1.781.442.2037
> Oracle Java Engineering
> 1 Network Drive
> Burlington, MA 01803
> lance.ander...@oracle.com
>
>
>
--
Louis Wasserman
lators
>>Does the 'identity' value need further explanation?
>>
>> Note: There is one minor change to the implementation. Currently in the
>> jdk8 repo j.u.f.DoubleBinaryOperator defines operateAsDouble. This method
>> has been renamed to applyAsDouble in the lambda/lambda repo. When these
>> changes are sync'ed from lambda/lambda this can be reverted. A similar
>> comment has been added to the code.
>>
>> -Chris.
>>
>
>
--
Louis Wasserman
Could we say that, in so many words, in the Javadoc?
On Tue, Dec 18, 2012 at 4:12 PM, David Holmes wrote:
> On 19/12/2012 8:40 AM, Louis Wasserman wrote:
>
>> It's not 100% obvious to me whether this refers to a default
>> implementation
>> in an interface, a clas
hod.toString(), expected, actual);
>>
>> A typo 'isDefualt' -> 'isDefault'. This uses two single-quote characters
>> to wrap the expected and actual value - is it intentional? I was wondering
>> that you meant to use one singe-quote character.
>>
>> Mandy
>>
>>
>
--
Louis Wasserman
he
patch to optimize BigInteger.floatValue() and doubleValue().
> Would anyone be able to review that patch so these can start moving
forward?
Thanks,
> Louis Wasserman
Java Core Libraries Team @ Google
guava-libraries.googlecode.com
-- Forwarded message --
> From: Loui
ided tests at the moment, but that is truly because the reference
implementation it's being tested against is faulty.)
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
On Sat, Jul 14, 2012 at 2:20 AM, Joseph Darcy wrote:
> Hello,
>
> Th
revealed this bug.)
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
y implement the HALF_EVEN rounding behavior with bit
twiddling. That said, I *did* encounter places where prior erroneous
behavior (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6358355) of
Float.parseFloat caused my correct implementation to fail tests...
Louis Wasserman
wasserman.lo...
s the speed
of those methods by something like two orders of magnitude in my benchmarks.
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
ow_bug.cgi?id=100208, and I was advised to
contact this mailing list to get it reviewed. What do I need to do?
Louis Wasserman
wasserman.lo...@gmail.com
http://profiles.google.com/wasserman.louis
37 matches
Mail list logo