Binary write to file slowing down my program

I have noticed this more on some types of computers, but I have two threads going.  One that captures 10MB images and queues them, and another thread that dequeues them and appends to a binary file.
If I disable the write to file, program chugs along well.  Once enabled, I noticed that the image capturing begins to act sluggishly, almost in sync with the writing to hard drive.  I have tried changing the write loop priority to the lowest as well.
It isn't holding up at the queue/dequeue step either.  Any pointers on what to try?  I'm almost certain that there is a memory sharing issue where one process is writing to 10MB image to memory, while the other is reading a 10MB image from memory, and this is tying things up.

dre99gsx wrote:
The main VI which hosts both of these loops is setup as User Interface
There's the problem, I think. The user interface subsystem is special - it's a single thread. This is required for certain things (interactions with the operating system and user interface, some external DLLs and ActiveX components) that require a single thread. In general, don't run your code in the user interface system unless you have a specific reason to run it there. As an example, property nodes that refer to front-panel items cause a switch to the user interface thread, so if you have VI that uses a lot of references to update the front panel, that VI should run in the UI system. In your case, if you switch your main VI to Standard and leave the subVIs set as Same as Caller, I think you'll see a similar speed improvement. There's more information about LabVIEW threading here, although that information is slightly out of date; if I remember correctly (couldn't find the reference in a quick search) LabVIEW now allocates as many threads per system as there are processor cores in your CPU, but not less than 4 per execution system with the exception of the user interface.

Similar Messages

  • Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Why does Acrobat Pdf converter file slow down my 2003, Windows  Word Program.  I only experience this problem when i convert a pdf file to a doc file.

    Hi Bill -- thanks for your reply!
    When I check the Document Properties on Acrobat I can see that the fonts used in the document (Cambria, Times and Windings) are listed as "Embedded Subset" in the Fonts panel. The machine it was created on did use an earlier version of OS X and an old version of Word, but it seems to have the proper fonts...
    -nick

  • How do i not have my photoshop linked to my macintosh hard drive because it slows down the program by using my hard drive space

    how do i not have my photoshop linked to my macintosh hard drive because it slows down the program by using my hard drive space

    Which version of mac os x and photoshop are you using?
    How much free space is on your hard drive?
    How much ram do you have?
    Photoshop needs to use your hard drive for scratch space.
    If you have more than one hard drive (not partition), you can assign photoshop's scratch disk to another hard drive.
    Optimize performance | Photoshop CS4, CS5, CS6, CC

  • Write to excel file slows down reading voltage channels

    Hi all,
    I read in input voltage data using PCI 6143 throught finite sampling. This VI is supposed to, for example, after acquiring 240 samples, I write all collected voltages to an excel file. Before I write the data into excel, I need to re-arrange the data array. This re-arranging task takes up quite a significant amount of time (about ~30ms). Hence, the 2nd batch of 240 samples collected is only done after arranging data and writing to file.
    Hence the process will be like, 0.9milli sec of data, wait 30milli sec, 0.9milli sec of data, wait 30milli sec and so on.
    So is it possible to pass this huge chunk of data to another VI, specifically doing the data manipulation and writing to file while the main VI continue collecting the voltage data without data losses?
    Does anyone have any suggestion by which mean am I able to do this?
    I saw a nice example in LV 7.1 example finder-> optimizing applications synchronizing tasks->Pass Data with Notifiers.vi
    Is this notifier method the solution to my problem or is there some other means to achieve the results?
    Thanks everybody!
    Best regards,
    Dick

    Hi Dick,
    I have some question you set the Sample Mode to Finite samples, why. If you do this you will miss samples!
    You start and stop the tasks every iteration, this will cause great wait times
    You can move the constat vi's outside the while loops.
    If you use continious samples you have to wire up the samples per channel to the ai read vi.
    If i profile the VI I see that voltage data-constants takes 3.6 ms of time (average).
    Also you should open the file outside the while loop and use the array to to spreadsheet string vi and write to text file to write the data. Successfully close the file after the while loop.
    In general opening/starting/closing/ending should not be done inside a repetative loop.
    It looks to me that 'voltage data constants.vi' generates an spreadsheet string from the data with a time column added.:
    this can be done like this:
    EDIT:Also you'r vi will 'remember' all the previous string and adds these together. If you don't want this initialize the shift register with an empty string, i missed the 'firstrun' case, but it is still better to initialize the shift register correctly, or you can connect the iteration number straight to the switch case
    Ton
    Message Edited by TonP on 09-28-2006 11:34 AM
    Message Edited by TonP on 09-28-2006 11:45 AM
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!
    Attachments:
    Example_BD.png ‏2 KB

  • CVI Runtime slowing down a program

    I just started working for a company as a test developer and they seem to be using CVI along with TestStand. They also have there own test software that uses TestStand and CVI together along with some SAP integration. I am using the software to test some computer that is connected to a test station via a serial port. The serial port monitos the activities of the uut and I am able to read the timestamps from the logs
    The problem that I am facing at this moment is that the timestamps from my computer are different compared to the timestamps from other peoples computers. I installed TestStand and CVI runtime engine on my own and I have found that different people have different versions of the runtime engine. I tried installing various versions of the runtime engine but none of them seem to give me the right time stamps. Basically the amount of time taken for my sequence to generate timestamps is more than twice the time taken by other people. 
    If there is someone out there that can help me out, I won't be able to thank you enough in words.

    The discrepancies are  "LARGE" in seconds. Everyone else can run their test in about 7 seconds and it is considered a PASS. While my machine takes 15-18 seconds to run the test and it is considered FAIL. I have narrowed the problem down to software by switch the uut as well as the test equipment. Further I have copied every file from an existing install folder from a "FAST" computer and replaced the files on my "SLOW" computer. Yet the slow computer remains slow. Upon swapping the "FAST" files with the "SLOW" files the fast computer still remained fast. I copied all the dll files from the system32 folder as well. There is something that I seem to be missing over here and since I am new to this I have no clue what to do.

  • Nikon D90 image files slow down bridge...even more

    We are running windows CS3 with ACR 4.6 and all my other Nikon files are fine in bridge, but when myself or a colleague try to use any file type from the D90 bridge comes to a grinding halt. We are trying to get approval to update to CS4 but it takes a while in my company. Is the upgrade to CS4 or Lightroom the only way to fix this? I believe that ACR update 4.6 was the last one for CS3, is this true? Thanks people.

    Thanks for your response Curt. Maybe I exaggerated a lttle when i said Bridge comes to a grinding halt, it does display the images clearly and allows me to do pretty much every task i need to do but it takes around 10 times as long as with any other camera file. If i attempt anything clever like batch process or adding metadata to multiple images then it crashes. I know bridge isn't lightening fast but the difference between files from my other camers and the D90 is astounding. No I don't use a card reader, direct upload form the camera to a hard drive. and Yes it has the same effect on the jpgs and nefs. cheers mate

  • Wouldn't jvm slow down programs?

    Hey, I have a question? Wouldn't the virtual machine slow down the program you are writing...because the code has to go through a whole nother layer instead of being compiled straight to assembly like C...

    Hey, I have a question? Wouldn't the virtual machine
    slow down the program you are writing...because the
    code has to go through a whole nother layer instead
    of being compiled straight to assembly like C...It's not that simple.
    * That layer can be made very thin, so that in most cases the overhead is negligible.
    * Modern JVMs use runtime optimization. Compiling C code to native executable means all the optimization will be done at compile time, without the ability to adapt to the runtime environment, execution patterns, etc.
    "Is Java slower than C" is a very broad and meaningless question. In the very, very general sense, yes, native code will execute slightly faster than code run by a VM. However, there are many other factors involved, and most of the time the performance difference in either direction is too small to be worth considering.

  • High CPU usage and program slowing down

    Hi. I have helped write a program in AS3 that uses classes. We have 2 frames in our movieclip that consists of an ant moving. We have a class of ants and can create 15 instances of them and the program runs fine with the ants walking around looking for food and going back to a corner that is their nest and going back out again. The ants also respond to mouse movement if the mouse pointer is near an ant.
    If we create more than 15 ants, then the program starts to slow down. If we have 30 ants on the screen, then there is noticable stuttering of the ant movement. The CPU usage on a P4 2.5Ghz Pentium is around 50%.
    Is this normal? or is something wrong?
    I would have thought we would be able to scale up the number of ants easily.
    Thanks
    Trev.

    Hi kglad.
    Thanks for the reply.
    I assume enabling cacheAsBitmap is set in the ant class Constructor, as we have tried that and it has helped, see below. We can now create 30 ants with very slight stuttering.
    We have an  ant class as below.
    public class TAnt extends MovieClip { // lots of code here }
    ant Constructor as below.
    public function TAnt(newX: Number, newY: Number, sW: Number, sH: Number, rCyc: Number) {
                this.cacheAsBitmap = true;
               // more code here }
    // We have implemented a Finite State Machine for the ant behaviour.
    regarding the ants using a loop and using a controller class, I am not sure what you mean.
    We are creating instances of the ants in the Ants.fla file which is in the Action file and add each new ant to an array. See below.
    for (var a = 0; a < nAnts; a++) {
        var newAntX = Math.random() * screenWidth;        // randomly generate ant location
        var newAntY = Math.random() * screenHeight;
        var rCyc = Math.random() * 800;
        var ant = new TAnt(newAntX, newAntY, screenWidth, screenHeight, rCyc);            // create ant
        addChild(ant);                                                   // add ant so visible on screen
        ants.push(ant);                                                 // add ant to array
    So we use an array for looping through the ants in the Ants.fla Action file.
    Is this the way you mean?
    Thanks
    Trev.

  • Write measurement to file slows data presentation

    I am sampling a light sensor at 1000Hz, and displaying the value using a waveform chart, and outputing to a file (using Write measurement to file), using a boolean.  Whenever i activate the write to file module, the acquistion rate slows down (i.e. I see the waveform propogate much slower). Has anyone else had this problem? Any solutions?

    Hi:
         Yes. We refer to low level vis as in programming languages. As higher the level, more "luxury" we give to the user, everything is done in a few steps, in a single step if possible. Low level ones do single tasks at a time: Open file, read file size, read some bytes of data (not the entire file), close the file, etc. etc. These instructions, even more troublesome for many people, gives you more control over the process. I'm attaching 2 files, one is a vi with some of LV menu vis which perform these smaller tasks (sorry it's in LV5, but any later version of LV you have, you would be able to open them), the other file is just a picture of the screen with the menus where those vis are (sorry again it's LV5, but you must be able to locate the corresponding menus in your version of LV).
         Good Luck.
    Attachments:
    Saving.vi ‏30 KB
    Saving.jpg ‏167 KB

  • PSE 10 system slows down when adding files to catalog

    I recently switched from PSE 3 to PSE10 and had issues converting the catalog.  I never did resolve those so I decided to start with creating a new catalog in PSE 10.  My first session of adding photos worked fine.  When I restarted the task the next day, I was asked in participating in making the product better by sharing information about my use with Adobe.  I agreed to participate and very quickly noticed that my computer slowed considerably when adding photos from my hard drive.  The process still worked but I experienced a dramatic increase in the time it took for photos to be added (e.g. the cursor spins for a couple of minutes while the task is working).  I went under my account preferences and opted out of the product participation program but the problem has persisted.  I rebooted the computer to see if that would help but it has not.  I have turned off all media analysis and both optimized and repaired my catalog and while this has provided some improvement, there are still instances where the system slows down.  Now it seems that every other folder's worth of pictures (does not matter how many photos) I add causes this delay.
    I appreciate any help anyone can provide in determining why this slow down keeps occuring. 
    FYI, I am running a new Windows 7, 64-bit system with 8GB DDR-3-1066MHz, and 2 TB hard drive.

    Have you also edited the Preferences (Performance) to increase the amount of RAM that PSE can use?
    Do you have many background processes running?  Having a single HDD means that everything running on your computer has to wait in the queue for disk access.
    How many photos are you importing?
    What file types are the photos?
    How large are the photos?
    Ken

  • Large Photoshop file has caused system slow down.

    I have Dual 2.0Ghz G5 which has worked very well since I got it last Spring. Just recently however I've had some slow downs. There are a number of things that I've noticed such as more frequent spinning beachball and font redraw issues.
    These issued started since I was working one a massive Photoshop file. I was doing work on a Trade Show booth which eventually resulted in a 10Gb Photoshop file! I realized I probably should have taken steps to reduce the size of the file but that's neither here nor there. Despite the size of the file I was still quite impressed with the performance of my machine. That said, I've found the general performance of the machine since working on this file to be diminished.
    I've done all of the typical maintenace items such as repairing disk and permissions via Disk Utility, clearing caches and running Maintenance scripts using Cache Out X, MacJanitor and Tiger Cache Cleaner, but still the performance of my machine has taken a hit.
    It's only since this has happened that I've started launching Activity Monitor to try and determine if there is something obvious going on which is hogging resources or not. This for me has raised questions of what is "Normal" for some common tasks. Presently kernal_task is using under 5% of my CPU with 50 threads running which seems like a reasonable number. But it is also using almost 110Mb of RAM and 1.35Gb of Virtual Memory. Both of those numbers seem quite high to me, but I admit that I never looked at them before so I have no gage as to whether these numbers can be considered normal or not.
    By all measures the machine still performs pretty good, but as I use this machine every day I know that it's not the same as it was prior to working on that large file. Is there something else related to Photoshop, temporary files, application caches or anything like that, that I should take a look at?
    Any input would be appreciated.
    Thanks!
    Dual 2.0Ghz G5   Mac OS X (10.4.4)  

    Hi Troy,
    First I would try using a separate HD for the scratch disk.As PS tries to read and write,it has to compete with the OS as it tries to hit its swop files. If Version Cue is on, turn it off.Get rid of any virus checking apps.Check your Ram.If you haven't allowed Tiger to run its cron scripts on a regular basis,and only do periodic maintenance, I would take the time to do an Archive and Install, or even wipe the HD,zero it and install tiger again. This I realize is a drastic measure,time
    consuming, and a pain.But if your whole system is slowing down?? Or if you get a new drive set it up to be your primary drive first and test your system on it before moving any of your PS files over from the old HD.Use the old HD as scratch disk
    Have you included the use of other utilies to check your HD? Drive Genius, Disk Warrior, TechTool Pro.No Norton utilities allowed.Hope this helps as there are a lot of places to look for the problem.

  • AME CS4 Batch - Slow Down After First File

    I've been using AME to batch timelines from various different Premiere Pro projects. Problem is the first one in the batch will take the normal amount of time around 2 hours. Then everyone in the batch after that takes 5 hours.
    If I stop the encode once it gets to the second file and slows. And then restart the program and put that one as first it renders in a fraction of the time....
    Why does AME drastically slow down after the first file in the queue?

    Where do you close the ResultSet?
    Where do you close the Statement?
    Presumably you only create one connection for all users or you close it somewhere.

  • Why does my data logging program slow down after a while?

    A data logging program created with Labview 5.1. Slows down after a few weeks and creates files in the Temp. directory.Computer is Siemens Scenic pro 124 MB ram and AT-MIO-16XE50 Data acquisition board. Also using Solartron Dig. probes and Fieldpoint units.

    Any chance that you are using Win 95/88/ME? Those OS's have well documented
    memory leaks which will consume all your available memory if an application
    is run long enough. Also there are some issues of memory management within
    LabView in the allocation of memory.
    The solution to the first is to switch to WinNT/2K. The second will be much
    more difficult.
    On Thu, 22 Feb 2001 03:19:12 -0800 (PST), Freek wrote:
    >A data logging program created with Labview 5.1. Slows down after a
    >few weeks and creates files in the Temp. directory.Computer is Siemens
    >Scenic pro 124 MB ram and AT-MIO-16XE50 Data acquisition board. Also
    >using Solartron Dig. probes and Fieldpoint units.
    ===========================================================================
    SolidW
    orks Research Partner National Instruments Alliance Member
    Christopher Dubea Phone: (504) 847-2280
    Vice President of Engineering Fax: (504) 847-2282
    Moving Parts L.L.C. email: [email protected]
    P. O. Box 6117 URL: http://www.movingpart.com
    Slidell, LA 70469-6117

  • PROGRAM SLOWS DOWN WHEN IT ENTERS A CASE STRUCTURE

    OK so here is the problem i am making this pid controller the output range is 0-100  in this program i am just trying to get it to work so i  did a compair function whereby when the controller output is 0 and the constant is 0 i start a case loop which will turn the output on for one second and off for one second .   when i enter the case structure the rest of my program slows down
    i have no idea why , i have tried to make a while loop and a case structure outside my main loop but i cannot get my signal from my compair statement to enter the second loop where i get my output to cycle in 1second intervals 
    below is the VI please help
    i am still learning how to use labview by the way
    thank you
    gary
    GR
    Solved!
    Go to Solution.
    Attachments:
    TMP36working!vi.vi ‏225 KB

    gary,
    The next thing you need to learn about LabVIEW is dataflow. This is the fundamental paradigm of LV and will explain your slow down issues.
    The basic dataflow concept is that any node (node = function, subVI, structure) can begin to execute when data is present on all its inputs and that no data will be present at its outputs until the node comopletes execution.
    How does this affect your VI? The true case has a 1000 ms Wait (actually two, one in each case of the inner case structure = redundant code). The case structure will not complete execution until the wait completes. And, the while loop does not complete its iteration until the case structure completes. The result: When the PID.vi output = 0, the loop will run at 1 second per iteration.
    What is the fix? Continue running the loop at 100 ms intervals. Keep a count in the case structure (true case) and another shift register of how many 100 ms intervals have passed. When the count reaches ten, toggle the output line.  Do not use the 1000 ms Wait.
    All the code in your inner case structure is unnecessary. Wire the Remainder output directly to the Arduino Digital Write VI.
    Be careful with the comparison to zero with floating point data. If the calculation which produces the data has round off errors you might get a value like 0.573E-15, but that is not equal to zero. It is better to compare to a small range of values above and below zero.
    Right to left wiring is much easier to follow when trying to understand what a program does. Using the Clean Up tool occasionally will help (although it will eventually frustrate you also).
    Lynn
    Attachments:
    TMP36working.2.vi ‏214 KB

  • File dialog box slow down execution

    Dear all,
    I am using Labview 8.2.1 with Windows XP.
    I have a program who's allow the user to select any file or folder thanks to File dialog box.
    For a reason that i don't understand when this dialog box is displayed, other parrallel while loop time execution goes slow down.
    Put on my LabView front panel File Path command without any code and press "Browse" file button as shown on joined picture_1 birng slow down execution of the while loop.
    Does any body could explain why this problem appear ?
    By switch off on LabView Tool parameter "Use native file dialogs" (picture_2). the problem disapear. Unfortunately this kind of old dialog box is not practical...
    If any body have an idea it could help me.
    Thanks.
    Solved!
    Go to Solution.
    Attachments:
    picture_1.JPG ‏16 KB
    picture_2.JPG ‏71 KB

    __KB__ wrote:
    Hello,
    When the File dialog box is running, other while loop time execution goes down.
    Thanks.
    This you have already mentioned in your first post... now my question is how you've actually figured it out... or can you share your code here???
    I am not allergic to Kudos, in fact I love Kudos.
     Make your LabVIEW experience more CONVENIENT.

Maybe you are looking for