Home Posts Topics Members FAQ
Pandiankk
2 New Member
Hello,
I am having a performance issue with one of my C#.NET console application. The application is faster(takes 10 mins) when it runs from our test environment, but slower on Production environment(tak es 80 mins). The settings/Configurations are same between the two environments.Th e application reads a text file, which has 180K records, and splits it up into multiple text file based on a condition. I am attaching the code with this. Please give your valuable suggestions and help me resolve this.
In the sample code, I have used stream writer to write in to files. I tried with File.AppendText , BinaryWriter etc. But no change in the performance.
Thanks
Jul 19 '10 #1
Subscribe Reply
3 1980
Joseph Martell 198 Recognized Expert New Member
I invite anyone to correct me if I am wrong, but when we start talking about access times for file reads/writes there are a lot of possible causes including hardware.
Are you using the same .Net framework version in test and production? How does your test hardware compare to your production hardware? Are you using a local disk in your test environment and not in production? If you are using a local disk in production, is the disk slower in production than in test? How busy is production as compared to test? Is your production server loaded down with other processes and services or are there any other processes which have a lot of file I/O accessing the same disk?
Jul 19 '10 #2
reply
Pandiankk 2 New Member
Thanks for your quick response. Both the servers have same same version of framework(2.0), OS,service packs installed. Both READ and WRITE operation is done on local disks on both the servers. Production server will be busy between 2 and 5 pm and this application is being executed in the morning. I don't see any other services, processes that do I/O operations or are memory/CPU expensive.
I checked with Infrastructure team and they said that both the servers are same in terms of hardware configuration and settings. I have no clue at all. Perhaps, Did i miss any settings in the application properties for it to run slower?
Thanks
Jul 19 '10 #3
reply
Tony Grimshaw
Joseph
I am having similar problems writing to a server. I think we have hardware problems. But there seems to be a major bottleneck in allocating space in windows server for a new file or extending old ones. So I tried the following experiment.
I preallocated the space for the file. In the language I am using this means writing record number 180000 before record 1. This forces windows to allocate all the space needed for the file in one step. I then wrote 180000 records of 256 bytes each. It took two minutes! Letting Windows allocate the space as and when needed this exercise would have taken 480 minutes on the system we have.
If you found another solution I would be interested
Regards
Tony Grimshaw
Nov 26 '10 #4
reply
Sign in to post your reply or Sign up for a free account.
Similar topics
1387 Importing data from text files by: Thomas Bartkus |last post by: Can anyone show an example MySQL command to import a text file into a table? I have a massive qty of data to get into a MySQL database on a server over the internet. Shouldn't I be able to do this with a bulk operation instead of a script with many tens of thousands of INSERT statements? I can deliver each tables data as comma delimited... MySQL Database |
11 4733 Splitting text files? by: MM |last post by: Hi I have never written any C programs before, but it seems that I need to do so now. Hope some of you out there can spend a few minutes and help me by writing a simple example of something fairly similar to what I need. I really think it is a simple matter if you know C programming, but to me it is not easy at all. An example from some... C / C++ |
12 3737 Writing data to disk?! by: Chris Springer |last post by: I'd like to get some feedback on the issue of storing data out to disk and where to store it. I've never been in a production environment in programming so you'll have to bear with me... My question is about storing data in a database. Yes I understand that you can link to a database in your program and read and write to the database etc... C# / C Sharp |
1 2390 Problem in Reading TEXT files using OLEDB by: svijay |last post by: hi I have got a strange problem. May I know any solution for this. Here is the detailed description about the problem We have got a mainframe system and also production and development server. .NET Framework |
5 2164 Writing to text files ... "overload" by: Alan Searle |last post by: I am exporting ms-access data to XML files. This works fine. However, I need to insert one line at the top of each exported file (i.e. a reference to the XSL file) and am having a problem with this. First I did the following: Export the XML file (using standard XML export) and then read the file (line by line) and writing it out... Microsoft Access / VBA |
6 6587 building an index for large text files for fast access by: Yi Xing |last post by: Hi, I need to read specific lines of huge text files. Each time, I know exactly which line(s) I want to read. readlines() or readline() in a loop is just too slow. Since different lines have different size, I cannot use seek(). So I am thinking of building an index for the file for fast access. Can anybody give me some tips on how to do... Python |
2 1987 Writing to Multiple Files - VB6 by: |last post by: Hi, I have an idea that I want to write to many (qty unknown untill run time but in the order of 5) text files as my application runs. They're log files dealing with different aspects of the application and will ultimately be sent to different users, hence why they have to be different files. I know that I want to be using the File System... Visual Basic .NET |
14 2025 Text files by: rafal_ |last post by: Is difference between interpretation of \n only difference ? C / C++ |
844 writing to text files on the internet by: smeltz101 |last post by: I'm familiar with linecache.getline(filename, lineno). But what I was wondering was if it was possible to use a web address in place of the filename. So rather than C:/Webcontent/mytextfile.txt I want to be able to substitute http://www.mysite/webcontent/mytextfile.txt The goal I hope to accomplish is to let people fill out my questionair and... Python |
2 4181 Problem with writing multiple text files by: as001 |last post by: Hi, I'm writing a windows application in C# using VS 2003. I got stuck where it has to write multiple output text files. Here's my piece of code: for loop { Random r = new Random(); //use millisecond and random to avoid similar filename C# / C Sharp |
7473
What is ONU? by: marktang |last post by: ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main... General |
7813
Maximizing Business Potential: The Nexus of Website Design and Digital Marketing by: jinu1996 |last post by: In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that... Online Marketing |
1 7431 The easy way to turn off automatic updates for Windows 10/11 by: Hystou |last post by: Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For... Windows Server |
7761
Discussion: How does Zigbee compare with other wireless protocols in smart home applications? by: tracyyun |last post by: Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the... General |
5976
AI Job Threat for Devs by: agi2029 |last post by: Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development projectplanning, coding, testing, and deploymentwithout human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then... Career Advice |
4949 Couldnt get equations in html when convert word .docx file to html file in C#. by: conductexam |last post by: I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert... C# / C Sharp |
3444 Windows Forms - .Net 8.0 by: adsilva |last post by: A Windows Forms form does not have the event Unload, like VB6. What one acts like? Visual Basic .NET |
1 1020
How to add payments to a PHP MySQL app. by: muto222 |last post by: How can i add a mobile payment intergratation into php mysql website. PHP |
709
Comprehensive Guide to Website Development in Toronto: Expert Insights from BSMN Consultancy by: bsmnconsultancy |last post by: In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating... General |
By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.
To disable or enable advertisem*nts and analytics tracking please visit the page.