Adnc | NET6 microservice/distributed development framework | Microservice library
kandi X-RAY | Adnc Summary
kandi X-RAY | Adnc Summary
The .NET6 microservice/distributed development framework is also suitable for the development of single architecture systems.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Adnc
Adnc Key Features
Adnc Examples and Code Snippets
Community Discussions
Trending Discussions on Adnc
QUESTION
I have a problem with my code, it takes too long to run the program when I call the method somme_2, and I want to reduce the run time. By the way the txt file that I'm using in this program contains almost 500_000 lines. Do you have any idea how to fix it ?
This is my main
...ANSWER
Answered 2021-Mar-11 at 14:59You can do one thing for sure. Let me list what all you can do to improve your runtime:
- Move word.length() outside for loop like: String wordSize=word.length();
- Move strings.size() - 1 outside the for loop like int stringsSize=strings.size()-1;
- In case of Java you can choose TreeSet which is implementation of Set interface. You can pass Collection object to the constructor of this class which will automatically sort the objects. Also when you add any object then it will be placed in sorted order.
- Also don't system.out.println as it is synchronized method, better log your output to a file location..
Hope this answer helps you in improving your runtime.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Adnc
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page