Speed And The Incrementation Methods - essay

free web hosting
Free Web Hosting > Computers & Tech > How-To's and Tutorials > OS > Linux

Speed And The Incrementation Methods - essay

WaCo
"Speed of various incremetation methods"

1) Method one
CODE
[tomek@localhost ebooks]$ LEGAL=1 LEGAL_2=1; LEGAL_3=1;
for i in `seq 100000`; do LEGAL=$(( $LEGAL + 1 ));
LEGAL_2=$(( $LEGAL_2 + 1 ));
LEGAL_3=$(( $LEGAL_3 + 1 ));  done;
echo legal\'s value is "$LEGAL"

Avarage amount of time that the process took: 9 seconds 29 hundredth.



2) Method two
CODE
[tomek@localhost ebooks]$ LEGAL=1 LEGAL_2=1;LEGAL_3=1;
for i in `seq 100000`; do LEGAL=$[LEGAL + 1];
LEGAL_2=$[LEGAL_2 + 1];
LEGAL_3=$[LEGAL_3 + 1];  done;
echo legal\'s value is "$LEGAL"

Avarage amount of time that the process took: 6 seconds 99 hundredth.



3) Method three
CODE
[tomek@localhost ebooks]$ LEGAL=1 LEGAL_2=1; LEGAL_3=1;
for i in `seq 100000`; do LEGAL=`echo $LEGAL + 1 | bc`;
LEGAL_2=`echo $LEGAL_2 + 1 | bc`;
LEGAL_3=`echo $LEGAL_3 + 1 | bc`;  done;
echo legal\'s value is "$LEGAL"

Avarage amount of time that the process took: 5 000 seconds.



4) Metoda four
CODE
[tomek@localhost ebooks]$ LEGAL=1 LEGAL_2=1; LEGAL_3=1;
for i in `seq 100000`; do LEGAL=`expr $LEGAL + 1`;
LEGAL_2=`expr $LEGAL_2 + 1`;
LEGAL_3=`expr $LEGAL_3 + 1`;  done;
echo legal\'s value is "$LEGAL"

Avarage amount of time that the process took: 2 000 seconds.



5) C++ example for comprehension
CODE
#include <iostream>
using namespace std;
int main()
{
 float a;
 for ( a=1; a <= 10000000; a++ ) { /*  100 x more than in bash !!!  */
 }
 cout << a;
return 0;
}

Avarage amount of time that the process took: not even a second.

Conclusion: The best incrementation method is second method, but compared to hightech programming languages it's still very slow.

Notes: tests were held on Duron 733 Mhz, 128 mb ram, riva tnt 2 32 mb.




[Added 2005-08-11, 07:49:21]

 

 

 


Reply

vizskywalker
I understand what it is, it is a rundown on various methods of incrementing values and how long they take. It seems to be doing so in batch scripting, perhaps we should ove it there?

~Viz

Reply

qwijibow
The comparason to c++ is not fair.
You will probably find that the c++ compiler is optimising your code, and replacing

CODE
 for ( a=1; a <= 10000000; a++ ) { /*  100 x more than in bash !!!  */
}


with the following code

CODE

a=10000000;


both pieces of code achieve the same end result.

try compiling the the zero optimise flag -O0

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : speed, incrementation, methods, essay

  1. Free Online Speed Test
    Post your results here (16)
  2. Flashget Download Manage
    High-speed safe and Multi-protocol support! (0)
    FlashGet is a leading download manager and has the highest amount of users on the internet. It uses
    MHT(Multi-server Hyper-threading Transportation) technique, supports various protocols and has
    excellent document management features. FlashGet is a freeware without any adware or spyware. Safe
    and clean: Optimize the system resource FlashGet can use up the lowest system resources and will not
    influence your normal work or study. increase the download speed and stability Flashget can
    increase download speed from 6-10 times. It uses MHT (Multi-server Hyper-threading Tr....
  3. Bonding Network Interfaces For Double Speed?
    How to? Win 2k3 (0)
    Hello. I have server 2003 os installed on my server. I have 2 NICs connected to same switch and need
    to double speed on 2 IP. How to do it? I used linux and it was easy there, simly set up bonding. But
    how to do it in 2k3 os? Thank for help, guys. /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" />....
  4. Need For Speed Pro Street Ps3 And Xbox 360
    (0)
    need for speed pro street ps3 and xbox 360 i just been playing pro street on the ps3 but i heard
    that it has few better functionality than on the xbox360 could anyone clarify with that with me as
    soon as possible has anyone played pro street on ps3 yet the graphics is just awesome....
  5. How To Turn Off Blur Effect In Nfsmw
    Need For Speed Most Wanted (1)
    There is no setting to turn off the blur effect from within the game, however it can be turned off
    in the registry. HKLM>SOFTWARE>EA GAMES>NEED FOR SPEED MOST WANTED> Change "g_MotionBlurEnable"
    to 0 instead of 1 You've just turned off motion blur. Hope u enjoy!....
  6. Need For Speed Pro Street
    New game? (2)
    I have heard about this game in a few places, and I think that it has been released. Has anyone
    played pro street, is it any good? Any new features compared to normal NFS (carbon, underground 2,
    etc) ?....
  7. Vb.net: How To Trap Exceptions In Invoked Methods?
    (5)
    I am having some trouble in trapping the exceptions raised by Invoked methods. By Invoked, I mean
    the methods that have been Invoked by the Control.Invoke method. Given below is a simple example
    of this problem. I have a Form named Form1 which contains an object Tim of the Timer class.
    Unlike the System.Windows.Forms.Timer object, the Timer class (FullName: System.Timers.Timer)
    raises the Elapsed event on a seperate thread. I think the Timer object does the same thing but
    synchronizes the event by raising it on the same thread as that of the Form it is in. When....
  8. How To Surf & Download Efficiently
    Speed up your Internet & change your IP Instantly (7)
    thanks anna. This tips I got from my frenz,maybe useful for u : If u often surf or download files &
    get troubles like : 1. Slow internet access, lag & timeout. 2. Your IP is banned / restricted to
    visit. 3. Afraid if your IP will be Logged. 4. Download result often errors. 5. Download frequently
    is limited (like at rapidshit, etc). And u hope great changes like this : 1. Connection more FAST
    (example to access https://). 2 . Connection more SECURE (Your IP address will be changed 100%
    GUARANTEED, HIGH ANONYMITY). 3. You can DOWNLOAD MORE FILES on internet! (May un....
  9. C# Tutorial : Lesson 8 - Functions/methods
    (0)
    The programming model has gone through many refinements, each change improving upon the model. One
    of the early changes was the inclusion of Subroutines or Subprograms. As the names suggest, these
    are fragments of code within a program. They offer the following advantages:- Reduction of code
    duplication by offering re-usability Simplifying program logic by decomposing the program into
    smaller blocks Improving readability of the program Why do we need functions?
    Consider the following program:- CODE using System; namespace ConsoleApplication1 { ....
  10. Internet Speed Test
    Internet Speed Test, Post your results here ! (13)
    Hai , I have introduced a Bandwidth Speed Test Service in my website located @ http://www.jbi.in
    I request you to post your speed test results here : First let me start : Service Provider
    Details : Service Provider : Bharat Sanchar Nigam Limited . Pvt / Govt. : Government Service.
    Location : India. Promised Speed : Upto 2 mbps Rental : Rs 250 per month ( nearly $6 per month
    ) Speed Test Results : My Ip : 59.92.113.38 ( Note your ip will be displayed when speed test
    result is shown ) My Speed : 784.90kbps Download Speed : 98.11 KB/sec Postion : DSL. ....
  11. Increase Internet Speed For Win Xp Home
    (9)
    All those Win XP Home users who have looked at the "increase your internet connection by 20%" and
    have been disappointed well I have found the answere. The bandwith limiter is a service known as
    "bits" or "Background Intelligent Transfer Service". If you disable this your connection will
    increase.....
  12. Speed Touch Usb Password Question
    (6)
    Hi, I recently had a Mac engineer help me with some problems I was having with my G4 Tower but
    wasn't exactly sure precisely what he was doing while he was here. I couldn't ask too
    many questions but I did notice that when it came to typing in the password for my Speed Touch USB
    (which I was waiting for him to give me the keyboard to do myself) he said he'd already done it
    by simply 'guessing' it. After he keft I tried restarting my G4 and typed-in my usual
    password....which worked just fine. Then, however, out of curiosity I deciided to try gio....
  13. Joke - Funny Essay On Indian History
    (2)
    I came upon this on some random site quite sometime back.. It's really funny if you can figure
    out the spelling mistakes and what actually this dude tried to mean. Some of the connotation will be
    lost upon non-Indian readers as there are lots of allusions to Indian History. Nevertheless, this
    should make a pretty decent reading... Have fun /biggrin.gif" style="vertical-align:middle"
    emoid=":D" border="0" alt="biggrin.gif" />
    ================================================================= QUOTE Indian History :
    Supposedly written by a schoolboy with all origin....
  14. Improve Xp Shutdown Speed
    (0)
    This tweak reduces the time XP waits before automatically closing any running programs when you give
    it the command to shutdown. 1. Go to Start then select Run 2. Type ‘Regedit’ and click ok
    3. Find ‘HKEY_CURRENT_USER\Control Panel\Desktop’Select ‘WaitToKillAppTimeout’ 4. Right
    click and select ‘Modify’ 5. Change the value to ‘1000′ 6. Click ‘OK’ 7. Now select
    ‘HungAppTimeout’ 8. Right click and select ‘Modify’ 9. Change the value to ‘1000′ 10.
    Click ‘OK’ 11. Now find ‘HKEY_USERS\.DEFAULT\ Control Pan....
  15. How To Double Firefox Speed
    (5)
    1. Type about:config in the address bar and then press Enter. 2. In the filter search bar type
    network.http.pipelining . Be sure the value field is set true ,if not double-click to set true .
    3. Go back to the filter search bar and type network.http.pipelining.maxrequests . Double-click
    this option and set its value to 8 . 4. In the filter search bar and type
    network.http.proxy.pipelining . Once opened double-click on it and set it to true . 5. In
    IPv6-capable DNS servers, an IPv4 address may be returned when an IPv6 address is requested. It is
    possible for Mozi....
  16. Wi-fi Speeds.
    Is it speed as vendors tell us? (12)
    I'm going to by Wi-Fi AP. There are many standarts of Wi-Fi. I'm thinking of speeds 54
    (802.11g) and 108 mb/s (802.11g). Is it real 108 mb/s (13.5 MB/s) or not? What will work better in
    a flat? And if I buy AP with 108 mb/s speed can I will be set speed slow to make connection better?
    Or nothing will change? And what you can say about D-Link 2100 AP ? ....
  17. Time Warping Or Not?
    Does time warp in strong gravity fields or when your moving close to l (22)
    This is a question I have been pondering for a little while. How would time warp if one was to be
    moving near the speed that light travels, or one was posititoned near a black hole. I have come up
    with a small theory for both; however, they are most likely incorrect /biggrin.gif"
    style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" />. I would appreciate any
    feedback on my thoughts. Gravity warping time Some scientists believe the time slows down the
    closer you are to the event horizon of a black hole; however, I don't believe the time can b....
  18. Slow Down To Speed Up
    (8)
    The situation. After I enter my password and hit enter, I used to have to wait 30sec to a minute
    before I could do something because all the other apps were waiting for the startup list to be
    finised. After some googl'ing, I found StartDelay
    (http://www.r2.com.au/software.php?page=2&show=startdelay), this great application allows you to
    delay the startup of some programs (and thus spreading the load) and it does work super. My firewall
    (sygate, great stuff, but a real resource hog) is now starting 20secs later, I've spreaded the
    other app and I can almost immedi....
  19. Web Server Uplink Speed Is Very Slow
    (2)
    I am running apache web server behind NetGear router. I can access all my documents with sufficient
    speed from all computers which are behind same router. . However, same server serves these
    documents very slow when I try to access it from somewhere outside. If I remove the router and plug
    in cable modem directly to my server, it has no problem. Could somebody please help me in this
    regard? -Aj....
  20. Need For Speed Carbon
    (26)
    EA has announced that they are working on the newest version of need for speed on June 22, 2006. the
    main web site for the game is located: http://www.ea.com/nfs/carbon/us/home.jsp This game is like
    another version of underground 2. using clips and videos like nfs:mw. It is expected to be released
    for every game console and pc including ps3 and wii once they are released. i couldnt find the
    expected release date but im expecting it to be released late this year. do you think this game
    will do as well as the other need for speeds and would u buy it?....
  21. How Do I Improve Wireless Speed?
    (14)
    We've setup a 54mbps wireless network, yet, the computers only work at a max speed of 9-11mbps.
    Is this the usual speed? I know overhead takes some of the bandwidth but seriously.. In addition,
    the router is just on the other side of the wall and I use the laptop by the router too.....
  22. How To Learn A Programming Language
    The two methods discussed (11)
    Hunting for a good book The more daunting task - hunting down a good book. The way is not easier
    one though. The search would require to shuffle through a big heap of books lying on a bookstore and
    ofcourse, its time consuming and generally, not to the dot. Once the book selected, only 20 percent
    is going to be the useful material all else (biggie 80%) is going to be waste for the reader though
    it will help to wash up the brain and clear some fundamentals. Reading books is quite convenient-
    after all, books are easy-on-eyes with well-organized and cross referenced m....
  23. Need For Speed Most Wanted!
    The best game! (19)
    I bought this game and I just love it! I have a Driving wheel do it doubles your fun! the
    police makes it a lot cooler and the graphic are just WOW!!!!! It would be a lot
    cooler if they would have a lot of shops lik ein underground 2.... But except that is a great
    game! I myself have the blacklist edition and its a lot cooler becasue you have a list of people
    you have to beat and if you beat all of tehm you win.......
  24. Burn Dvd Over 16x Speed Rate
    The impossible became possible (5)
    Its seems that Plextor has passed over the fisic limit of speed DVD burning rate. The Manufecters
    had an agreement about maximum speed to DVD burning that was 16x ( 21MB/s]. This limitation existed
    because wasn't possible increase the speed over the 11.000 rpm without damage fisicly the DVD.
    But Plextor announced a new DVD+- RW - PX-760A that attchive the 25MB/s what is equal to 18x speed.
    Plextor says that this speed can be used by +/- R certificated DVD 16x in the market. Also will be
    able to burn DVD+R Dual Layer ( 8,5 GB) to 10x. SOmeday we will have IN....
  25. How To Increase Windows Shutdown Speed
    when you enabled “clear Page File at shu (39)
    How to increase Windows shutdown speed when you enabled “clear Page File at shutdown”? /blink.gif'
    border='0' style='vertical-align:middle' alt='blink.gif' /> Note that making incorrectly changes
    to the registry may damage your system; please back up any valued data on your computer. 1) Go to
    Start menu > Run > and type regedit and click OK. 2) Find following address: HKEY_LOCAL_MACHINE
    \ SYSTEM \ CurrentControlSet \ Control \Session Manager \ Memory Management
    3) In right side right click on “ClearPageFileAtShutdown”, select Modify and mak....
  26. Is Your Internet Speed Good Enough Vs. Cost ?
    (88)
    do you think you are paying too much for your internet and not getting the proper speed, i had it
    once when i was on adsl but now have moved to proper broadband now witch is 4mb witch is really
    fast. like that uk online its too good to be that speed at its price but ill keep with who im with.
    /biggrin.gif' border='0' style='vertical-align:middle' alt='biggrin.gif' /> Try and keep your
    topic titles more relevant to your post content. This is the 4th post by you that I've had to
    edit the title. Your title should at least try convey an overall gist of your post - ....
  27. Speed Up Your Connection In Windows XP
    (41)
    Speed up your connection in Windows XP /blink.gif' border='0' style='vertical-align:middle'
    alt='blink.gif' /> By default, the packet scheduler limits the system to 20% of the bandwidth of a
    connection, to increase bandwidth : 1-Open Run dialog box from Start menu. 2- Type “gpedit.msc” and
    press Ok. 3- When Group Policy run, go to Local Computer Policy > Computer Configuration >
    Administrative Templates > Network > Qos Packet Schedule 4- in right side, right click on Limit
    reseivable bandwidth and select Properties. 5- In Setting tab under Limit reservable bandw....
  28. What Speed And Package U Getting From Your Isp?
    Is it worth it. (52)
    I am from South East Asia and the country is called Singapore. We have three major ISP for my
    country. I am using 1500Kpbs and upload of 128kpbs. The plan is unlimited/ /cool.gif' border='0'
    style='vertical-align:middle' alt='cool.gif' /> ....
  29. NFSU2
    Need For Speed Underground 2! (39)
    This game blew me away! I loved the graphics! Instead of me getting it on my Xbox or PS2, I
    decided to get it for GameCube! I got it on GC because that's what I had it on for NFSU!
    I loved this game! Even though it contained only 5 stages, the cars, animation, and upgrades
    were quite impressive! I love racing games! I have no favorite game! But for the racing
    genre (currently), this game won my vote! Plus, Brooke Burke was in it!....
  30. Speed up your windows and Pc!
    (21)
    Speed up your windows and Pc! Right click on " My Computer" and select " Properties" . Go to "
    Performance" and click on " File System". In "Settings" section change " Desk Top Computer" to "
    Network Server" For speed up your windows: Run " Registry Editor", and go to below address :
    HKEY_CURRENT_URER\Control Panel\Desk Top Add a parameter : (String Value)(REG_SZ)
    (value data =0 ),and name it "MenuShow Delay"....

    1. Looking for speed, incrementation, methods, essay

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for speed, incrementation, methods, essay
advertisement




Speed And The Incrementation Methods - essay



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE