Nitin Agrawal
Contact -
  • Home
  • Interviews
    • Secret Receipe
    • InterviewFacts
    • Resume Thoughts
    • Daily Coding Problems
    • BigShyft
    • CompanyInterviews >
      • InvestmentBanks >
        • ECS
        • Bank Of America
        • WesternUnion
        • WellsFargo
      • ProductBasedCompanies >
        • CA Technologies
        • Model N India
        • Verizon Media
        • Oracle & GoJek
        • IVY Computec
        • Nvidia
        • ClearWaterAnalytics
        • ADP
        • ServiceNow
        • Pubmatic
        • Expedia
        • Amphora
        • CDK Global
        • CDK Global
        • Epic
        • Sincro-Pune
        • Whiz.AI
        • ChargePoint
      • ServiceBasedCompanies >
        • Altimetrik
        • ASG World Wide Pvt Ltd
        • Paraxel International & Pramati Technologies Pvt Ltd
        • MitraTech
        • Intelizest Coding Round
        • EPAM
    • Interviews Theory
  • Programming Languages
    • Java Script >
      • Tutorials
      • Code Snippets
    • Reactive Programming >
      • Code Snippets
    • R
    • DataStructures >
      • LeetCode Problems
      • AnagramsSet
    • Core Java >
      • Codility
      • Program Arguments OR VM arguments & Environment variables
      • Java Releases
      • Threading >
        • ThreadsOrder
        • ProducerConsumer
        • Finalizer
        • RaceCondition
        • Executors
        • Future Or CompletableFuture
      • Important Points
      • Immutability
      • Dictionary
      • URL Validator
    • Julia
    • Python >
      • Decorators
      • String Formatting
      • Generators_Threads
      • JustLikeThat
    • Go >
      • Tutorial
      • CodeSnippet
      • Go Routine_Channel
      • Suggestions
    • Methodologies & Design Patterns >
      • Design Principles
      • Design Patterns >
        • TemplatePattern
        • Adapter Design Pattern
        • Decorator
        • Proxy
        • Lazy Initialization
        • CombinatorPattern
        • RequestChaining
        • Singleton >
          • Singletons
  • Frameworks
    • Apache Velocity
    • Spring >
      • Spring Boot >
        • CustomProperties
        • ExceptionHandling
        • Issues
      • Quick View
    • Rest WebServices >
      • Interviews
      • Swagger
    • Cloudera BigData >
      • Ques_Ans
      • Hive
      • Apache Spark >
        • ApacheSpark Installation
        • SparkCode
        • Sample1
        • DataFrames
        • RDDs
        • SparkStreaming
        • SparkFiles
    • Integration >
      • Apache Camel
    • Testing Frameworks >
      • JUnit >
        • JUnit Runners
      • EasyMock
      • Mockito >
        • Page 2
      • TestNG
    • Blockchain >
      • Ethereum Smart Contract
      • Blockchain Java Example
    • Microservices >
      • Messaging Formats
      • Design Patterns
    • AWS >
      • Honeycode
    • Dockers >
      • GitBash
      • Issues
  • Databases
    • MySql
    • Oracle >
      • Interview1
      • SQL Queries
    • Elastic Search
  • Random issues
    • TOAD issue
    • Architect's suggestions
  • Your Views
I am not an expert but as per my analysis, I suggest not to start new features, until you have understood them & have strong reasons to use them. Otherwise I see some performance impact.
Here I will be putting my understanding as I get any.
Just check simple program below using different ways & their results in next image, so understand the performance of new features before using them. And a humble request to the coders, don't mess up the project to use new features without understanding those, as every new feature comes with its cost -

import java.util.ArrayList;
import java.util.IntSummaryStatistics;
import java.util.List;
import java.util.stream.IntStream;

public class AnotherTest {
public static void main(String[] args) {
int range = 10000000;
int[] al = new int[range];
List<Integer> list = new ArrayList<Integer>();
ArrayList<Integer> alist = new ArrayList<Integer>();
long start = System.currentTimeMillis();
for(int i = 0; i < range; i++) {
al[i] = i;
}
int min = Integer.MAX_VALUE;
for(int i : al) {
if(i < min)
min = i;
}
System.out.println("Min : " + min);
System.out.println("Time taken by array : " + (System.currentTimeMillis()-start));
start = System.currentTimeMillis();
for(int i = 0; i < range; i++) {
list.add(i);
}
min = Integer.MAX_VALUE;
for(int i : al) {
if(i < min)
min = i;
}
System.out.println("Min : " + min);
System.out.println("Time taken by list : " + (System.currentTimeMillis()-start));
start = System.currentTimeMillis();
for(int i = 0; i < range; i++) {
alist.add(i);
}
min = Integer.MAX_VALUE;
for(int i : al) {
if(i < min)
min = i;
}
System.out.println("Min : " + min);
System.out.println("Time taken by array array list : " + (System.currentTimeMillis()-start));
start = System.currentTimeMillis();
for(int i = 0; i < range; i++) {
al[i] = i;
}
System.out.println(IntStream.of(al).min().getAsInt());
System.out.println("Time taken by stream : " + (System.currentTimeMillis()-start));
start = System.currentTimeMillis();
for(int i = 0; i < range; i++) {
al[i] = i;
}
IntSummaryStatistics is = IntStream.of(al).summaryStatistics();
System.out.println(is.getMin());
System.out.println(is.getAverage());
System.out.println("Time taken by IntSummaryStatistics : " + (System.currentTimeMillis()-start));
}

}

Picture
Powered by Create your own unique website with customizable templates.