VOOZH about

URL: https://dzone.com/users/1332957/guttso.html

⇱ Dang Ngoc Vu - DZone Member


Dang Ngoc Vu

Java architect and performance optimization at Kyanon Digital

Hanoi, VN

Joined Nov 2014

Stats

Reputation: 694
Pageviews: 154.9K
Articles: 4
Comments: 10

Articles

C# and Java Comparison: The C# Struct Advantage
In this article, we discuss the advantage of C#'s struct when compared to Java's use of classes and Junion to offer a struct-like data structure.
August 27, 2019
· 14,510 Views · 7 Likes
Optimizing Memory Access With CPU Cache
Learn more about how you can optimize memory access with CPU cache.
April 9, 2019
· 19,100 Views · 11 Likes
Iteration Over Java Collections With High Performance
Learn more about the forEach loop in Java and how it compares to C style and Stream API in this article on dealing with collections in Java.
Updated July 13, 2018
· 87,841 Views · 20 Likes
Java 9 Flow API vs. LMAX Disruptor
Check out this comparison of the Flow API's and LMAX Disruptor's functions and performance benchmarks in this article.
Updated May 30, 2018
· 33,450 Views · 21 Likes

Comments

C# and Java Comparison: The C# Struct Advantage

Sep 04, 2019 · Dang Ngoc Vu

Hi Trevor,

JMH guaranty that Blackhole.consume() doesn't impact to the benchmark result. JVM can detect and remove block of code that don't modify anythings nor don't impact to any Object. That why JMH provide Blackhole utility. Unfortunely, BenchmarkDotNet doesn't have the similar feature.

I try to modify benchmark code of C# as below but the benchmark result still the same. I agree with you that we need to check IL code to make sure what's going on but it's out of my ability, I need to study more about this topic.

[Benchmark]
public int Loop()
{
int result = 0;
for (int i = 0; i < N; i++)
{
result = data[i].x ^ data[i].y;
}
return result;
}

ArrayList or LinkedList?

Feb 12, 2019 · Tarun Telang

My company have a product with more than 100 customers, there is a List that can contains from 3 to 100k items. If I set initial size too small, then there are overheat of reallocate the array. If I set initial size too big, then we waste a lot of memory with case of 3 items. LinkedList is more suitable in this case.

ArrayList or LinkedList?

Feb 11, 2019 · Tarun Telang

I got your point, but I had a performance issue when using ArrayList and cannot predict size of items, then I changed to LinkedList and it worked perfectly.

ArrayList or LinkedList?

Feb 11, 2019 · Tarun Telang

each time an array is fulled, JVM will move the array to a new region of memory with size of 1,5*old_size. If you need few more slots but JVM still allocate big memory, then you will encounter a memory waste.

ArrayList or LinkedList?

Feb 07, 2019 · Tarun Telang

when you cannot assume the size of array, LinkedList is more memory effective.

The Evolution of the Producer-Consumer Problem in Java

Oct 10, 2018 · Ioan Tinca

Java 9 has Flow API and LMAX Disruptor is mature since very long time, but I don't know "Java blockchain"

Iteration Over Java Collections With High Performance

Jul 15, 2018 · Dang Ngoc Vu

Thank you for your comment! I try with
public List<Integer> streamMultiThreadWithCollect(BenchMarkState state){
List<Integer> result = state.testData.stream().parallel()
.collect(Collectors.toCollection(ArrayList::new));
return result;
}

The result is better, with 50ms/op with the same condition.

Iteration Over Java Collections With High Performance

Jul 06, 2018 · Dang Ngoc Vu

Thank you for your comment, I've just updated source code and benchmark results

Java 9 Flow API vs. LMAX Disruptor

May 24, 2018 · Dang Ngoc Vu

Thank you for your comments, I'll update benchmark code and run again

Single vs. Multiple Filters in the Java Stream API

Jan 02, 2017 · A N M Bazlur Rahman

Also run at differrent env, parallel stream run slower at single core or old CPUs, but faster than serrial stream at multi cores CPUs

User has been successfully modified

Failed to modify user

Let's be friends: