Threads to keep the CPU faster than the disk?

Greetings,
I hope this is the correct place to post a question like this - I did not see a forum specific to C/C++ programming on Solaris.
I'm currently writing a data conversion program and would like to get better performance. The programming language is straight C, Solaris 10, E25K with 8 CPUs and 16G RAM allotted to my zone. I do not have admin on the box. I am compiling 64-bit with lots of compiler options for performance.
The process is very linear and most of the optimization examples I find are for making loops run in parallel and such. Well, I don't have any loops. I'm moving a lot of data from a set of source files, doing some transformation and validation, then writing to the appropriate target file. No recursion or matrix math here...
I wrote my initial test program which would basically spin through the source files and write empty target files. Doing this I was able to process about 70,000 source records per second - which was acceptable and on par with the speed of simply copying the disk files from one place to another.
Once I started adding logic, the records per second started to drop drastically. I expected this to some degree, but adding just the basic initial logic cut the records per second in half, and after that the performance dropped in a pretty linear fashion as I added transformation logic. Mind you, most of the logic is moving source to target and space padding the target, validating a date range, etc.. Nothing complex by any stretch of the imagination, there are just a lot of fields.
Before I spend a lot of time trying to multi-thread the application, I wanted to see if my expectations are realistic. My thinking is that 8 CPUs should be able to keep up with the disk subsystem and that my conversion should not take any longer than the amount of time it takes to simply copy the data from one point to another. Possible?
Currently I'm processing like this:
1. mmap open all sources (there are about 10 to 15 depending)
2. collect counts of all source records in a given "set"
3. wait for any previous targets to finish writing to disk
4. process the current set of source records and write target records to memory buffers for each target
5. when a given target buffer is full, aiowrite to the target file
6. while there are source records, goto step 2
Basically I used aiowrite to get a little free async operation in that any target buffers that are ready to be written could do so while the next set of source records is being grouped (being read from the mmap'd source files). I also try to keep things as fast as possible by not moving the data more than necessary. Usually my transformation logic can move the data directly from the mmap'd file to the target buffer, and in other cases only a single move of the data needs to be done.
What I think I would like to do is create a thread that groups the source record sets into 8 independent memory locations. This thread's job is to simply keep those group locations full. Then 8 worker threads would pick the next source "set" from the pool and process it, and only have to sync on a mutex when writing to the target file.
Any insight or feedback would be greatly appreciated.
Thanks,
Matthew

If your application is not using threads, then the entire program is running in a serial state, waiting for i/o etc. To check how your little program works, use:
truss -a -d -D -f -l -o your_truss_output_file.log your_application

Similar Messages

  • HT4755 I followed the instructions and when logging into the disk there are no files to be displayed?

    I am setting up a shared hard drive via airpot extreme base station. I followed the instructions to set up user accounts to set privileges to the disk and upon completion and logging in no files are showing up on the disk?

    You have to declare your intention to keep the disk appendable each time you write something, or the last thing you wrote is the last it will accept.

  • Will my duel 800 G4 work with Leopard? Its fast than the 867 G4?

    My duel 800 G4 was the top of the line when I purchased it, much faster than the 867 G4, which seems to be the limit on the new Leopard operating system. Will I still be able to upgrade? I have seen on other Apple forums many people asking the same question? I would appreciate any help.

    Well, the minimum system requirements that Apple tells us really aren't always totally truthful. For example, they say OS 10.4 needs a minimum 256 MB Ram, and a DVD drive. That isn't true. I have tested this on a few different machines and found that the true minimum requirements are 192 MB for installation, 128 MB for running. On an ibook G3 500 mhz with 128 MB RAM, 10.4 ran surprisingly well. It was a little laggy of course, but it was stable and reliable. Also, you do not need a DVD drive, as you can use target disk mode to install the system from another computer (yes, the other computer needs a dvd drive...but I am speaking in specifics). What they say in their requirements is for the general public, but most of the time they aren't entirely dogmatic on those requirements.
    If it were my guess, I would say 10.5 will probably run on your system. If they entirely cutoff installation based on clockspeed, I'm guessing some mac-hacker will figure it out.
    Also, as far as your computer being top of the line "when you bought it"-that's the issue. Basically everyone's mac was top of line or near top of the line at it's release. But we all know the computer industry is not a slow moving market. Your computer can be outdated in a few months or a year. I helped a guy buy his first mac a few months ago (imac). 2 days later Apple released the new imac. That's the nature of computers. And you really can't expect Apple to keep supporting machines approaching 7 years old (my ol' Gigabit). They want to be at the head of the market, and pushing the old out is some times the only way to do it.
    You always have the option to upgrade your system. Go and look at some cpu upgrade cards. They aren't all that expensive. For $400 I turned my dual 450 to a dual 1.4 Ghz (and don't forget the level 3 cache). Third party upgrades are what keep us old timers goin.

  • The logic in LEOPARD being faster than TIGER?

    I'm still trying to grasp this concept. I have NEVER heard of an upgrade that goes faster than a previous version...
    DISK SPACE
    If I upgrade my MacBook from Tiger to Leopard using the "archive and install feature" on the disk, am I adding more system files to my existing ones? Or does the installation process of LEOPARD somehow remove more files than it installs?
    In my world, less disk space = slower computer. Maybe there's a little logic in that.
    Message was edited by: You Got Pwnd

    You Got Pwnd,
    Actually, every subsequent version of OS X has performed better, on every supported architecture, than the previous version. In some cases, quite a bit better and faster.
    Leopard is a somewhat different story, though. On older, but still support machines, it can be very much slower than Tiger. The amount of available RAM has a lot to do with this (on some older machines, the maximum RAM "puts the squeeze" on Leopard), as does the presence (or not) of advanced graphics processors.
    Certainly, many things are faster in Leopard than they are in Tiger, given a machine that meets certain requirements (enough RAM, advanced graphics, etc.). Leopard's Finder is now multi-threaded, so the apparent speed of the GUI is much improved. Also, the more advanced interaction of the CPU and the GPU provide increased response for many facets of the GUI.
    Then, there is the potential full 64-bit aspect of Leopard. If it is being run on a 64-bit machine, it can be significantly faster than any previous version for many tasks.
    Disk space only affects speed when it is insufficient for the current virtual memory usage, and in fact, some modern hard drives perform better when more disk space is being used (specifically, those that use the relatively new PMR technology). Up to a point, it is more RAM that has an affect on overall performance, not disk space.
    "Archive and Install" moves every part of the current OS into a "Previous Systems" folder, and installs a brand-new, and complete, copy of the new OS. In other words, it uses at least twice the amount of disk space currently being used (by system files, at least). Only an "Upgrade" installation removes and replaces as needed to migrate from one in-place version to another, and only an "Erase and Install" formats the startup volume and installs the new OS, and only the new OS, to the erased volume.
    Once you have migrated to Leopard, an additional option is available: "Restore from a Time Machine Backup." While your Time Machine backup, on an external/secondary drive, is not "bootable," the Leopard install disk can use it to completely "Restore" a bootable system, including all your applications and user data, to an erased startup volume. This is not fresh installation of OS X with your data and applications copied back, but a complete restoration of everything from the backup, and it takes much, much less time to perform than a normal installation (it is dependent only on the speed of your external drive. In my case, that is a Firewire 800 drive, and a ~50 GB system takes only 30 minutes to completely restore).
    Scott

  • Can the WD Raptor make my 2.0 Dual faster than my new 2.3 Dualcore?

    A few weeks ago I had asked what would make my machine at work - 2.3 Dualcore w/2GB of RAM - slower than my home machine; 2.0 DP w/2.5GB of RAM.
    The new Dualcore was unreasonably slow and I followed the few suggestions to wipe the drive, which brought it up to snuff... but I still find it slower than my 2.0 at home. At simple tasks (contextual menu pop-ups, software loading, etc...) as well as more complex Photoshop and 3D tasks.
    It's not the very last generation 2.0, but the one prior, e.g. 8GB of RAM capable, PCI-Express, and liquid cooling, etc...
    I doubt the .5 of RAM can make that much difference, is the WD Raptor the difference and am I just spoiled by it?
    Thanks for any suggestions.
    -Vincent

    So you have a Raptor as boot in your home based Dual Processor and it seems faster than the faster Dual Core you have at work.
    That's understandable, especially since the Dual Core most likely has a 7,200 RPM 250 GB slow drive (and more filled being at work, using more fonts?), plus the Dual Core shares a fronside bus, unlike the Dual Processor which has one for each. Photoshop pre-CS2 swaps memory to disk, so a faster boot drive will help. (Tiger overrides CS2's RAM limit, so more RAM will give better performance)
    At home you have the Raptor as boot and most of your user files on the second drive I'm assuming, allowing you to access two drives at once using two busses.
    Of course CPU intensive tasks the Dual Core 2.3 should beat the Dual 2, but since Mac OS X is heavy boot drive speed dependant (caches, swaps etc) the "User Interface feel" should be more responsive on your Dual 2, giving you the impression it's faster.
    Big fat filled slow boot drives really cripple Mac OS X performance (NAND RAM coming?)
    I've written a better explaination here
    click for text doc

  • Are the brushes in Photoshop CC faster than CS6 - still need to use CS5 for large files

    Hey,
    Are the brushes in Photoshop CC any faster than Photoshop CS6.
    Here's my standard large file, which makes the CS6 brushes crawl:
    iPad 3 size - 2048 x 1536
    About 20-100 layers
    A combination of vector and bitmap layers
    Many of the layers use layer styles
    On a file like this there is a hesitation to every brush stroke in CS6. Even a basic round brush has the same hesitation, it doesn't have to be a brush as elaborate as a mixer brush.
    This hesitation happens on both the mac and pc, on systems with 16 gb of ram. Many of my coworkers have the same issue.
    So, for a complicated file, such as a map with many parts, I ask my coworkers to please work in CS5. If they work in CS6 I ask them to not use any CS6 only features, such as group layer styles. The only reason why one of them might want to use CS6 is because they're working on only a small portion of the map, such as a building. The rest of the layers are flattened in their file.
    Just wondering if there has ever been a resolution to this problem...or this is just the way it is.
    Thanks for your help!

    BOILERPLATE TEXT:
    Note that this is boilerplate text.
    If you give complete and detailed information about your setup and the issue at hand,
    such as your platform (Mac or Win),
    exact versions of your OS, of Photoshop (not just "CS6", but something like CS6v.13.0.6) and of Bridge,
    your settings in Photoshop > Preference > Performance
    the type of file you were working on,
    machine specs, such as total installed RAM, scratch file HDs, total available HD space, video card specs, including total VRAM installed,
    what troubleshooting steps you have taken so far,
    what error message(s) you receive,
    if having issues opening raw files also the exact camera make and model that generated them,
    if you're having printing issues, indicate the exact make and model of your printer, paper size, image dimensions in pixels (so many pixels wide by so many pixels high). if going through a RIP, specify that too.
    etc.,
    someone may be able to help you (not necessarily this poster, who is not a Windows user).
    a screen shot of your settings or of the image could be very helpful too.
    Please read this FAQ for advice on how to ask your questions correctly for quicker and better answers:
    http://forums.adobe.com/thread/419981?tstart=0
    Thanks!

  • Sun Studio 12 is still much faster than the newest express 11/08

    I gave the newest Express 11/08 a try on my laptop. I found that Studio 12 is still
    much faster than the express version at least on my laptop. See the old messge below.
    http://forums.sun.com/thread.jspa?threadID=5321607&tstart=15
    I think poor performance is a bug for a compiler. Sun should fix it.

    I think poor performance is a bug for a compiler. Sun should fix it.Thanks for noting :)
    This has already been filed as a bug - http://bugs.sun.com/view_bug.do?bug_id=6735472.
    And as you can see it is even already fixed.
    Unluckily it missed Express 11/08 integration time slot (by a mere week or so).
    It is reasonable to expect it to be available at the next Express/whatever release happens next.
    regards,
    __Fedor.

  • If i export my project, it runs much faster than in the canvas. How can I fix that?

    If i export my project, it runs much faster than in the canvas. How can I fix that?
    I'm from germany, sorry for my english!

    When you export your project, it is "compiled" into video format. Any player will play it at its frame rate.
    Motion is a compositing application. It has to make many more times the calculations needed to animate everything and 90% of the time, it's just not possible for Motion to keep up with "real time".  It's to be expected. Learning to live with that fact will make life a lot easier for you, I promise.
    There are a few things you can do to help speed up Motion:
    Reduce temporary play ranges to no more than about 5 seconds at a time. You can move the Play Range In and Out markers from section to section. Motion does all of its real time rendering in RAM. The longer the play range, to more it has to work managing that memory.
    Remove Preview Icons from the Layers list ( View menu > Layers Columns > Preview will toggle the views)
    When you play your animation, turn off on screen guides: (command - / will toggle onscreen guides)
    In Motion 5, reducing the quality of playback from the Render menu does not make a lot of difference anymore, so you might as well keep the default settings of Dynamic, Full and Normal on. However, Motion Blur, Frame Blending, Field Rendering, as well as the lighting options will affect playback, sometimes by quite a lot. So if you have Lights, turning off Lighting, Shadows, and Reflections will get back a lot of real time playback speed (just remember to turn on all that you need before rendering, or these things will be left out of the export!)
    HTH

  • Just got my iPad 2 three days ago and noticed the battery life drops faster than I expected at least compared to the others ones around

    Just got my iPad 2 three days ago and noticed the battery life drops faster than I expected at least compared to the others ones around, please I need to know the cause and how to effect necessary changes that will prolong the battery life as I have gone through the settings which includes turning off the push notifications, reduce brightness and so on but that doesn't seem to help much.

    FYI
    The quickest way (and really the only way) to charge your iPad is with the included 10W or 12W (5W on Mini) USB Power Adapter. iPad will also charge, although more slowly, when attached to a computer with a high-power USB port (many recent Mac computers) or with an iPhone Power Adapter (5W). When attached to a computer via a standard USB port (2.5W, most PCs or older Mac computers) iPad will charge very slowly (but iPad indicates not charging). Make sure your computer is on while charging iPad via USB. If iPad is connected to a computer that’s turned off or is in sleep or standby mode, the iPad battery will continue to drain.
    Apple recommends that once a month you let the iPad fully discharge & then recharge to 100%.
    How to Calibrate Your Mac, iPhone, or iPad Battery
    http://www.macblend.com/how-to-calibrate-your-mac-iphone-or-ipad-battery/
    At this link http://www.tomshardware.com/reviews/galaxy-tab-android-tablet,3014-11.html , tests show that the iPad 2 battery (25 watt-hours) will charge to 90% in 3 hours 1 minute. It will charge to 100% in 4 hours 2 minutes. The new iPad has a larger capacity battery (42 watt-hours), so using the 10W charger will obviously take longer. If you are using your iPad while charging, it will take even longer. It's best to turn your new iPad OFF and charge over night. Also look at The iPad's charging challenge explained http://www.macworld.com/article/1150356/ipadcharging.html
    Also, if you have a 3rd generation iPad, look at
    Apple: iPad Battery Nothing to Get Charged Up About
    http://allthingsd.com/20120327/apple-ipad-battery-nothing-to-get-charged-up-abou t/
    Apple Explains New iPad's Continued Charging Beyond 100% Battery Level
    http://www.macrumors.com/2012/03/27/apple-explains-new-ipads-continued-charging- beyond-100-battery-level/
    New iPad Takes Much Longer to Charge Than iPad 2
    http://www.iphonehacks.com/2012/03/new-ipad-takes-much-longer-to-charge-than-ipa d-2.html
    Apple Batteries - iPad http://www.apple.com/batteries/ipad.html
    iPhone: Hardware troubleshooting (Power/Battery section also applies to iPad)
    http://support.apple.com/kb/TS2802
    Extend iPad Battery Life (Look at pjl123 comment)
    https://discussions.apple.com/thread/3921324?tstart=30
    New iPad Slow to Recharge, Barely Charges During Use
    http://www.pcworld.com/article/252326/new_ipad_slow_to_recharge_barely_charges_d uring_use.html
    Best Practices for iPad Battery Charging
    http://www.ilounge.com/index.php/articles/comments/best-practices-for-ipad-batte ry-charging/
    Tips About Charging for New iPad 3
    http://goodscool-electronics.blogspot.com/2012/04/tips-about-charging-for-new-ip ad-3.html
    How to Save and Prolong the battery life of your new ipad
    https://discussions.apple.com/thread/4480944?tstart=0
    Prolong battery lifespan for iPad / iPad 2 / iPad 3: charging tips
    http://thehowto.wikidot.com/prolong-battery-lifespan-for-ipad
    iPhone, iPod, Using the iPad Charger
    http://support.apple.com/kb/HT4327
    Install and use Battery Doctor HD
    http://itunes.apple.com/tw/app/battery-doctor-hd/id459702901?mt=8
    To Extend a Device’s Battery Life, Get to Know It Better
    http://tinyurl.com/b67c7xz
    iPad Battery Replacement
    http://www.apple.com/batteries/replacements.html
    In rare instances when using the Camera Connection Kit, you may notice that iPad does not charge after using the Camera Connection Kit. Disconnecting and reconnecting the iPad from the charger will resolve this issue.
    ~~~~~~~~~~~~~
    Since you are a new iPad user .....
    Complete guide to using iOS 6
    http://howto.cnet.com/ios-6-complete-guide/
    Guide to Built-In Apps on iOS
    https://sites.google.com/site/appleclubfhs/support/advice-and-articles/guide-to- built-in-apps-ios
    You can download a complete iOS 5 iPad User Guide and iOS 6 iPad User Guide here: http://support.apple.com/manuals/ipad/
    Also, Good Instructions http://www.tcgeeks.com/how-to-use-ipad-2/
    Apple - iPad - Guided Tours
    http://www.apple.com/ipad/videos/
    Apple iPad Guided Tours - Watch the videos see all the amazing iPad apps in action. Learn how to use FaceTime, Mail, Safari, Videos, Maps, iBooks, App Store, and more.
    http://www.youtube.com/watch?v=YT2bD0-OqBM
    http://www.youtube.com/watch?v=ROY4tLyNlsg&feature=relmfu
    http://www.youtube.com/watch?v=QSPXXhmwYf4&feature=relmfu
    How to - Articles & User Guides & Tutorials
    http://www.iphone-mac.com/index.php/Index/howto/id/4/type/select
    iPad How-Tos  http://ipod.about.com/lr/ipad_how-tos/903396/1/
    You can download an iPad User Guide to the iPad from the iTunes store.
     Cheers, Tom

  • I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image,

    I am using a Photoshop cs2, and I wonder if it is possible to keep the settings of the guidelines when closing an image, with the actual document ? It would be nice to have the guidelines locked down, I find it than when opening the same or another image, the guidelines are not locked, it is annoying to have to lock them down again. and it would actually be nice, to ba able to give specific directions when placing the guidelines. Thanks

    Then why are the guides unlocked when I reopen a document that I saved with the guides locked ?
    Thanks.

  • Firefox 4 is not compatible with the skin i had been using for my browser, old factory black... i would prefer to keep this skin rather than use firefox 4... how can i revert back to the previous version of firefox?...

    ''Duplicate post, continue here - [https://support.mozilla.com/en-US/questions/816154]''
    firefox 4 is not compatible with the skin i had been using for my browser, old factory black... i would prefer to keep this skin rather than use firefox 4... how can i revert back to the previous version of firefox?...

    Older versions of Firefox are available here:
    http://www.mozilla.com/en-US/firefox/all-older.html

  • I want to add more capacity on hard drive of time capsule. Can i add a normal usb driver? I will see it as an external drive in the time capsule network? It will work as fast than time capsule? Thanks

    I want to add more capacity on hard drive of time capsule. Can i add a normal usb driver? I will see it as an external drive in the time capsule network? It will work as fast than time capsule? Thanks

    Can i add a normal usb driver?
    Yes, but be sure that the drive is formatted correctly for Mac in Mac OS Extended (Journaled)
    I will see it as an external drive in the time capsule network?
    The drive will appear as a shared network drive, like the Time Capsule.
    It will work as fast than time capsule?
    No, the drive will operate at about half or 50% of the speed of the Time Capsule.

  • Exported video size smaller than original video size. How do I keep the original size?

    I exporting a video from Adobe Premiere CS6 today, and I noticed the video was about 1/2 times smaller  than the original video I put in. I then uploaded the video on YouTube, and the size was still the same. I tried to change the preset to 1080p 29.97, 1080p 25, etc. and the same with 720p, and 480p, but the size only changed slightly.
    How do I keep the original size after exportation of videos?

    More information needed for someone to help... please click below and provide the requested information
    -Information FAQ http://forums.adobe.com/message/4200840
    Also, exactly what are you editing, and what are your export settings?
    Also, The tutorial list in message #3 http://forums.adobe.com/message/2276578 may help

  • Is the iPad 3 faster than the iPad 2?

    Hi,
        Is the iPad 3 faster than the iPad 2? Also, how much better resolution is the iPad 3 from the iPad 2? I was just wondering because I heard that the new iPad isn't worth it's price.

    The New iPad is not remarkably faster, but does have a faster chip, which is required to handle the amazing Retina display.  The new display on New iPad is without question significatly better than iPad 2 and offers nearly 4 times the resolution of iPad 2.  Whether it's important to you, only you can know.  To see the difference, go to an Apple store where they still sell iPad 2 and New iPad.  For me, the difference was night and day, which is why I sold my iPad 2 and upgraded to New iPad.

  • The error console, I clear it and 4 minutes later it has 100's of yellow, pink & blue message lines in it, without me making 100's of clicks or commands ?? .... Other than the error console filling up faster than a superman, it seems to be working fine.

    The error console, I clear it and 4 minutes later it has 100's of yellow, pink & blue message lines in it, without me making 100's of clicks or commands ?? .... Other than error console filling up faster than a superman, it seems to be working fine. why does it register so many yellow, pink & blue warnings, errors, etc. ???
    This happens no matter where I am browsing, yahoo, google, mail or news. Clearing the console seems to help with the speed of FF after an hour or so of browsing, it slows down terribly and if not cleared and or shut down and relaunching FF, both actually, it is painfully slow, like dial-up.

    Hi Mac Attack,
    My computer will not disconnect from the internet.  It seems to find a clone router and continues even when I shut down and unplug my my own home iy
    Your main question was 'chopped' in the title. Please reply in the body of a reply box with the full question and anything you have tried. And no, the long report was not helpful .
    If the same website is opening each time you launch a browser (Safari?) hold down the shift key as you launch to prevent previous pages from opening.
    Have a look at your settings in Safari > Preferences. Especially General and Privacy.
    Reset Safari to remove cookies and other stored data.
    System Preferences > General
    Have a look at your settings in System Preferences >  Security & Privacy.
    Call back with more questions.
    Regards,
    Ian

Maybe you are looking for

  • OutlookSyncClient has encountered a problem and needs to close.

    I am unable to sync my Touch. When I try to sync, Windows reports "OutlookSyncClient has encountered a problem and needs to close." There is no other indication of the cause of the problem. I'm running 7.6.2.9, with Outlook 2003 SP3 (11.8206...) on W

  • Error in maintaining data in V_T510P Premium table

    Hi All, When I try to maintain the data in maintenance view V_T510P, it is giving an error message "Entry  USD  does not exist in T500W - check your entry". Though currency maintained in table T500W, still the error comes. Please help. Regards, Jeetu

  • CRM Interactive Reports Activation

    Hi All We need to activate de Interactive Reports in CRM But we don't know what to do with the BI Client. BI Cliente is a BI product Installed in the Same Sever, but in different Client? Or we just have to customize the the Analytics part in CRM? Our

  • I tried to restart my computer, now it is restarting over and over

    Hi, I re-started my computer and it wouldnt start, it just keeps restarting al by itself. i managed to get one of the SuperDrive drawers open and inserted the 10.5 disk trying to start from the CD. its been doing this for over an hour

  • Updating materials issued for  production thru movement type

    hi we are using repetitive manufacturing scenario, and we are using back flush,  how to find out the materials issued for production thru movement types, from which tables can i get the data from AUFK  i am getting the movement types and the order nu