DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Curious about the future of data-driven systems? Join our Data Engineering roundtable and learn how to build scalable data platforms.

Data Engineering: The industry has come a long way from organizing unstructured data to adopting today's modern data pipelines. See how.

Threat Detection: Learn core practices for managing security risks and vulnerabilities in your organization — don't regret those threats!

Managing API integrations: Assess your use case and needs — plus learn patterns for the design, build, and maintenance of your integrations.

Avatar

Dang Ngoc Vu

Java architect and performance optimization at Kyanon Digital

Hanoi, VN

Joined Nov 2014

Stats

Reputation: 694
Pageviews: 149.4K
Articles: 4
Comments: 10
  • Articles
  • Comments

Articles

article thumbnail
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
· 13,910 Views · 7 Likes
article thumbnail
Optimizing Memory Access With CPU Cache
Learn more about how you can optimize memory access with CPU cache.
April 9, 2019
· 17,615 Views · 11 Likes
article thumbnail
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
· 85,839 Views · 20 Likes
article thumbnail
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
· 32,043 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

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: