Quick file loading in C# [closed] - c#

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a requirement to load a file containing up to 1 million lines of string data. My first thought is to use C# 5.0 async to load the data whilst not blocking the UI thread. If the user tries to access something that relies on the data they will get a loading message.
Still I would like the fastest possible method in order to improve the user's experience.
Is the speed of reading data from the disk purely a function of the disk speed and thus StreamReader.ReadAllLines() is as performant as other c# code? Or is there something 'fancy' I can do to boost performance programmatically. This does not have to be described in detail. If so what approximate percentage improvement might be achieved?
I am purely interested in read speed and not concerned with the speed of code that may process the data once loaded.

First of all, take a look on File size, here is detailed Performance measurements

Related

How to Process large JSON Data By MultiThreading in C#? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I am new to threading and Multithreading . I have a method which Fetches Ids as input in JSON format from DB as
{
"ID": ["1",
....,
.....
"30000"]}
Now these Ids are to be processed again via WebAPI POST call. The issue is,though the code is optimized, it is taking hours to process all data.
How can I process these Ids in batch or multi threading to make it faster?
Recent versions of .NET have great libraries you can use that take care of the multi-threading for you.
Check out the Parallel For Each loop: https://learn.microsoft.com/en-us/dotnet/api/system.threading.tasks.parallel.foreach?view=netcore-3.1
You pass it a list and everything inside the loop is executed once for each item in the list and C# will do some of the iterations in parallel (multi-threaded). That means you could do your processing for more than one ID in parallel.
Whether or not it improves performance depends on the environment and work being done.

Passing of value from one separate application to another [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I'm looking for advice and experiences about proper way to create outputs from one separate application to other independent application which must take this value for own implementation conditions. to make it clearer in primitive way for example output application writes some undated value to the text file, and another running application with available path to this file reads it in time loop and if value is found makes some implementation. But I'm trying to find what is more correct way to do the same to pass it from one application directly to another
Message Queing is certainly what you are looking for.
It will let some applications put messages on the queue and some others (or not actually) consume these messages.
https://msdn.microsoft.com/en-us/library/ms711472(v=vs.85).aspx

How to reduce processing speed of excel file in c# [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
We are having a excel data Invoice input of 3 million customers every month to be processed.
There are only 8 fields in the data. Now the time consumed in processing to PDF format is too big & we are not able to meet the TAT.
Can anyone suggest any input to reduce processing speed?
There are several possibilities to reduce processing time.
Please check before what the bottleneck is.
To reduce processing time here are some ideas:
Use TPL to parallelize processing https://en.wikipedia.org/wiki/Parallel_Extensions#Task_Parallel_Library
Maybe use a thirdparty library to process excel files (e.g. Aspose.Cells, Aspose.PDF)
When the hardware is the bottleneck => use SSD and a better CPU or use CUDA to process https://en.wikipedia.org/wiki/CUDA

Windows 8 APP : Store data [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 8 years ago.
Improve this question
What is the best way to store data for a Windows 8 APP ?
I need to store from one to thousands of little pictures (max 300x300px) (Load from FilePicker).
Also, is there a recommended practice to store picture (A class rather than an other) ?w
Storing 1000 of images uncompressed in memory could hang computer, depending on images and memory available. So that's not the best practice.
You haven't mentioned why you need to do this, so there is no clear solution, but some guidelines:
if you need to show many pics on screen, use XAML (e.g. Image element) and set path to the image on web or local disk. Windows will do the caching for you. Also, put Image element in GridView or ListView and use Data binding
if you afraid that images might get lost and it is not enough to keep just path, copy them in ApplicationData LocalFolder.
if you need to do some operations on images, then load into memory the one you need or load them one by one.

RavenDB only via http? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am trying to learn RavenDB and using it's .Net client. If I am not wrong I think the main reason to use NoSql database like RavenDB is speed. It seems to be very fast as it is not relational. However when I am trying to play with .Net client of RavenDB I find that all calls are REST based calls. Doesn't that slow down speed? For each call of adding document it makes some call to HILO which basically lets the .Net client know which should be the next unique number to use and then it makes 2nd call to store the actual document.
You seems to be running RavenDB in a console app, and checking what happens in a very short lived fashion.
Run RavenDB in a real app over time, and you'll see that it is highly optimized for network usage.
You only see this hilo call once per X number of updates, and that X number changes based on your actual usage scenarios.
The more you use RavenDB, the faster it becomes.

Categories

Resources