Measure mobiles computational performance

The source code here measures mobile phones computational performance. Is there anybody who can explain for me what is the thougt behind the pi? What does pi?
computationPerformance= pi(10);
1617 //allows the JIT compiler to optimize the function pi(long)
1618 computationPerformance= 400000 / pi(500000);
1823 private int pi(long max)
1824 {
1825 int p= 0;
1826 long m= 100000000l;
1827 long start= System.currentTimeMillis();
1828 while (max > 0)
1829 {
1830 p += (int) (m / (max * max--));
1831 }
1832 long duration= System.currentTimeMillis() - start;
1833 if (p - 4 == 0)
1834 {
1835 // Stupid test (never true) to fool the optimizer, which would think p is useful.
1836 duration= 0;
1837 } /* we could compute PI this way :
1838 double pi;
1839 pi=Math.sqrt(6.0d*p/(double)m);
1840 */
1841 return (int)duration;
1842 }

Well, it id often used in benchmarks... but there is no relationship. Any other algorithm would do just as well.

Similar Messages

  • Measure mobiles processor speed

    Hello
    I am trying to find out how i can measure mobile phones processor speed with help of J2ME. Is there any algorithm that can be used to measure the computational speed? Is there any way to measure Java's virtual machine speed? I found source code from www.tastephone.com where the author measures the processor speed, but i am nor really understand why he is doing like he does:
    private int getMHz(int maxi)
    1783 {
    1784 int i= 2;
    1785 long duration, start= System.currentTimeMillis();
    1786 while (--maxi != 0)
    1787 {
    1788 if ((maxi & 1) == 0)
    1789 i += 2;
    1790 // if maxi is even, add 2 to i, we don't add if it's odd.
    1791 }
    1792 duration= System.currentTimeMillis() - start;
    1793 int mhz= 0;
    1794 if (duration != 0)
    1795 {
    1796 // mhz = number of CPU cycles for the loop : 6
    1797 // * number of loops : i
    1798 // / (number of cycles per second in 1MHz / number of ms in 1s / 100)
    1799 // = 1000000 / 1000 /100
    1800 // = 10 so we divide by 10
    1801 // / duration in ms
    1802 // so now mhz holds a value in MHz multiplied by 100 to have 2 decimal figures
    1803 mhz= 6 * i / 10 / (int)duration;
    1804 // rounding the decimal figure
    1805 if ((mhz - (mhz / 10) * 10) >= 5)
    1806 mhz= mhz + 10;
    1807 mhz /= 10;
    1808 // keeps one decimal figure instead of two
    1809 // always return a non zero value (test successful)
    1810 if (mhz == 0)
    1811 mhz= 1;
    1812 }
    1813 return mhz;
    1814 }
    He wirtes at line 1796 that mhz = number of CPU cycles for the loop : 6
    Why is number of CPU cycles for the loop 6? Where did he found that?
    Thanks

    He wirtes at line 1796 that mhz = number of CPU
    cycles for the loop : 6
    Why is number of CPU cycles for the loop 6? Where did
    he found that?Well, I guess, he checked how many byte code instruction this loop takes. He forgets that this figure does not say anything about the amount of real CPU cycles it takes to make one loop. In consequence, the outcome of the computation is mosty setainly wrong.

  • Actual time recording (computer performance problem?)

    I'm a beginner.
    I'm recording the output file in every second, but the time of output file is different from the actual time.
    I'm wondering if this is due to the computer performance (450MHz, 128MB) or if vi program can be implemented. I attached the file I use. The problem comes up when I use a vi with 50 channel outputs, but doesn't come up if I reduce the channels to around 20.
    Thank you.
    Attachments:
    LODS_MFC2.vi ‏460 KB

    It sounds like you are certainly running into timing issues. I see that in your VI, you use AI Sample Channel to acquire data from a single channel everytime the loop iterates. This is not the best means to go about doing such. The reason being that each time the VI is called, it has to setup the operation, then perform the read, and then clear the operation. What you should be doing is setting up the operationg outside the loop, perform only reads in the while loop, and then clear the task after you are complete. LabVIEW gets shipped with several examples that behave just this way, you should look in the example finder for these.
    Additionallly, if you read the help on AI Sample Channel.vi, it states it does a single, untimed measurement of a channel. Since
    you posted with the title "actual time recording", I feel that timing might be of importance to you.
    You never did mention what version of LabVIEW you have, or the hardware and drivers you are using, so I am leaving this post rather general. If you have some more questions after reading through this post and looking through some of the examples, post back to this discussion with more information, and I will try and help you out further.
    Sincerely,
    Jared A.

  • After upgrading macbook pro from mountain lion to mavericks computer performance slowdown

    after upgrading macbook pro from mountain lion to mavericks computer performance slowdown

    Fixing a Mavericks Installation Problem
    How to manage a failed OS X Mavericks installation | MacFixIt - CNET Reviews.
    Try these in order:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.

  • Middleware approach in mobile computing

    hi guys,
    can any one help me in writing the code for this topic
    " This project targets at developing a prototype system that provides a middleware
    solution to support the communication between PDA clients and web servers over
    wireless network.
    The case study of this prototype includes a PDA client requesting information of the
    location inside a university campus. The request is sent through PDA over wireless
    network covered in the campus to a web server. The web server can return text, image
    and audio1 about "where am I" information on the PDA. The server can also be able
    to answer questions such as "how do I get to x from y?" would also be of use to any
    newcomer on campus. This system is useful for a newcomer to the university by just
    sending the request through the website using his or her PDA.
    This system is useful for a newcomer to the university by just sending the request
    through the website using his or her PDA "
    If you guys have any solution regarding this please let me know.
    Regards
    Rajiv

    I am so proud to be using the ipad and the iPhone in education. Now I can finally say that I am proud of its new operating system. It is about time Apple. You were the game changer with the first iphone and now you are changing the world of mobile computing again. Thanks for listening to our suggestions, complaints, hopes, and dreams.

  • The smart rugged device: Introducing the CN51 mobile computer

    Special Guest Post by Intermec Product Manager Joe DeWenter
    Have you had a chance to check out our new CN51 rugged mobile computer yet? Read on for some additional insight on just how smart this device really is.
     

    Hi,
    If you're getting Smart errors this would indicate that your Hard Drive is failing and will need to be replaced.
    If your notebook is still under warranty, contact HP and arrange to have the drive replaced - you can check your warranty status Here.
    If you live in the US, contact HP Here.
    If you are in another part of the world, start Here.
    If you are out of warranty and would like a guide on replacing the Hard Drive yourself, please let me know - include the full Model No. and Product No. of the notebook ( from the service tag underneath your notebook ) - see Here for a further explanation.
    Regards,
    DP-K
    ****Click the White thumb to say thanks****
    ****Please mark Accept As Solution if it solves your problem****
    ****I don't work for HP****
    Microsoft MVP - Windows Experience

  • Active Directory and Mobile computer with 10.8.4

    I've managed to get our Power Book (first mac on network) on AD domain, it was a labor of love,
    I have gotten every thing working smooth, Volumes mounted with and without Alias, but the last thing I am trying to configure is Mobile Computing,
    so a user can work off the Network and have it Sync when he logs back in. Mobile computer pulls the UNC from AD fine and mounts his home directory, however it does not sync to his home directory on the network...
    I am sure I am missing something silly, but right now my brain is fried... Any help please?

    Got it, thanks guys works pretty well too... I don't know why it wasn't working before, AD integration is still strange.

  • Mobile component performs very slow

    Hello,
    I have created a component wich actually draws a country map containing about 400 cities.
    My first approach was to write a 'country' class (UIComponent) which created 400 city objects (UIComponent also).
    Each city object draws its own shape using graphics object.
    Result was a beautiful country with colored cities in it.
    But... testing on iPhone or iPad was really slow.
    So I decided another approach:
    I created only one class which extends from Image.
    In it, I used the graphics object to draw all cities. The result is just one image object about 2500 x 2000 pixels.
    Result: almost no performance gain! Very, very slow.
    I'm just using one image!
    Any ideas how I can get better performance?
    Thx,
    Dany

    I don't quite understand what you mean with 'If Re: Mobile component performs very slow shows up near the top'
    I do use a lot of points to plot but only while drawing on the graphics object. Once that is done, I only have one image object sizing about 600 x 400. I've put it in a scroller.

  • Java for mobile computer!

    Hi!
    I have a mobile computer that runs Microsoft� Windows Embedded CE. NET 4.2... I can access the Internet with it, but I can't run jsp scripts... what do I have to install in my mobile computer to run jsp scripts???
    null

    When you say you cannot run jsp scripts, do you mean jsp pages on the internet, if so this has nothing to do with your devise as you only need an HTML browser to access jsp, all processing is done on the server.
    If you are tryinjg to run pages locally you will need java installed, and web-server software installed.
    You can get Java for mobile devices, but I dont think you would get a web-server running.

  • Computer performance Base score

    Hi Support,
    What is the minimum & Maximum Base score for computer performance.
    My computer is showing 3.3 base score.
    Please let me know whether the above score is Good or what is the best score for the computer performance.
    Regards
    Pradeep.R

    Not sure about "totally" but I am sure you'd find a lot of people to agree with you.
    Afaik the WEI gui was removed in 8.1 but it seems that, in 8.1 at least, you can still use winsat from the command line to see the score. See
    http://www.techrepublic.com/article/unearth-the-windows-experience-index-in-windows-8-1-with-powershell/

  • Apple has done it again! They are the best innovators in mobile computing technology on the planet.

    I am so proud to be a part of this new generation of mobile technology.

    I am so proud to be using the ipad and the iPhone in education. Now I can finally say that I am proud of its new operating system. It is about time Apple. You were the game changer with the first iphone and now you are changing the world of mobile computing again. Thanks for listening to our suggestions, complaints, hopes, and dreams.

  • Tools to measure Content DB performance?

    Dear All,
    Is there a tool to measure content DB performance not size and specially if it is having a lot of sites is it possible to know monitor this specific site performance on the content DB?
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation. Please remember to mark the reply as answer if it helps

    Hi John,
    Let's say there is, what would you like to see as the output for the DB performance?
    The way I see it users are accessing SharePoint sites, and you want to know if these are loading fast enough for them. In this case, you can use developer dashboard to see why pages might load slower than others.
    If your overall performance is really bad, try taking a look at the SharePoint components that are responsible for showing the page. Some things to check:
    - Server resources (CPU/RAM/disk space/disk IO) on all SharePoint and Database servers
    - Caching (BLOB, object etc.)
    - Distributed Cache
    Please let me know if you have any additional questions.
    Nico Martens
    SharePoint/Office365/Azure Consultant

  • When reading an encoder the computer performance suffers with program duration.

    I�m working with a PCTIO-10 counter/timer card with Atmel AM9513A microcontrollers and a LAB-PC-1200AI Card. The Computer I�m using is an older Compaq proliant 600 MHZ server running NT and Labview 5.1
    The objective of our application is to create a VI that controls a photometric lab. We swing a boom with a photocell attached to the end through a light source and collect intensity measurements along the way. We use the 1200AI card to activate a solenoid that controls direction of the boom and the TIO card is used to count encoder pulses and monitor boom location. The application then collects intensity measurements at specified boom angles. This is where we start to have problems� The application works, as it should, monitoring boom location and collecting data at the correct angles: 10 deg, 20 deg, 30 deg, etc� I wrote the application to execute in a do while loop constantly reading the TIO card and generating a boom angle. I then poke the results into a shift register. As soon as I read the correct angles from the shift register I collect the photocell data. The problem comes in after the program executes for a few minutes. The machine performance degrades as execution time elapses until ultimately the machine starts to miss pulses. Let me clarify this statement: the card/machine seem to keep track of all pulses emitted by the encoder BUT the machine can�t get back to read the cards register before it misses the required angles. E.g. I want to collect data at 50 deg boom angle. The register is counting the pulses but the computer reads the register in a loop as: 46, 46, 46, 46, 47, 47, 47, 48, 48, 51, 51, 52, 52, etc� The machine is counting the encoder pulses but the software can�t seem to �get back� to the register in time to pick up on the correct angles. This problem is amplified as program execution time elapses until the machine starts to miss a series of numbers and also has trouble with monitor redraws/updates. The Windows NT task manager shows no memory leaking. I�ve also tried to add small wait durations in the program to allow Windows time to multitask and do maintenance. It didn�t help. I then scraped the original program and wrote a new one that starts and stops the counters when not needed for short periods. I also reset the registers at the top and bottom of the boom stroke in an effort to free up the processor and/or memory, but the problem persists. I�m either writing a poor program or I need a way to dedicate to processor to this task. Any input will be appreciated.

    It's difficult to pinpoint without any code posted. However, a sluggishness that increases with run time can be a symptom of a program that keeps resizing and/or copying fairly big arrays. Can you post some of the code?
    Also, there may be a different approach that will let you hardware-capture excess data, then extract the subset of interest in a post-processing step. This way you can be sure not to miss any points.
    The idea would be to perform a buffered analog acquisition of your photocell(s), using the encoder pulses as an external scan clock. There are shipping examples that show how to do such things, and I think the Lab-PC-1200AI should support them.
    You could set up an acquisition buffer a bit bigger than the # of encoder pul
    ses in your boom's range of travel. After collecting one scan for each encoder position, you can then extract data at or around the positions of particular interest. Just note that the data at index i corresponds to your previous method's position i+1.
    -Kevin P.

  • Measure mobiles CPU

    Hello
    I would like some help with how i can measure the CPU speed of a mobile phone. I know that the "clock cycle" is relative with the CPU speed and i am also very interesting to know how can i measure the clock cycle with help of J2ME? Is there a "clock cyckle" at all mobile phones, and if not, how can i mesure the CPU speed at that phones without clock cycle?
    Thank you very much for your help
    Nick - Sweden

    You can't really measure overrall performance. Some phones might be good at number crunching but terrible at drawing graphics. Others might be lightning fast when it comes to drawing, but have a horrible performance when accessing the RMS. Etc.
    You have to look at what your application is going to do, and figure out which areas might affect it the most, and then you can assess the performance requirements for that specific case. The site I linked to has statistics for many different areas all broken down nicely, so it's a lot more useful than just saying "this phone has a performance of 6 and this other one has a performance of 8.5".
    shmoove

  • How to Measure Function Module Performance?

    Please can you tell me how I can measure the performance and trace the actions of a Function Module in R/3?
    The function module in R/3 is run when a user calls a WebDynpro action from a WebDynpro screen within the SAP Portal.
    I have tried running a trace on a user (ST05) but that only shows table actions (e.g. reads/fetch etc.). Also it does not appear in ST04 or ST03N. I would like to know how long the program actually takes to run.
    Thanks.
    Paul

    Hi,
    if I want to measure the runtime required to run some Abap, I use SE30. However i used it only for normal Dynpro application, not WebDynpro.
    The detail level of the created trace can be configured. The aggregation level should be set to "Full" or "By call" at the beginning. Disabling aggregation leads to huge trace files.
    You can select which statements should be traced. If you disable an option it's runtime is not lost but add to the traced action in the next level. If for example "Open SQL" is disabled, the time used by it is added into the net time of the method, function module of subroutine. Otherwise if "Open SQL" is enabled the net time of a function module does not include SQL time. SQL time is then listed separately.
    Greetings

Maybe you are looking for

  • SCOM Gateway Server Upgrade from 2012 SP1 to R2

    Hi, I am upgrading our SCOM environment from 2012 SP1 to R2. But unable to upgrade the Gateway Server. The installation of R2 setup stops with error message: "The operation manager gateway can't be installed on a computer on which the Operation Manag

  • Need help in installing Snow Leopard without DVD drive

    Hi, I have a White Macbook 2008 model with 2.1 ghz processor and 1 GB Ram. The dvd rom is not working in my machine. It spits out the dvd's 99 out of 100 times. I need to upgrade from 10.5.8 to 10.6. Apple has sent me a single disk to install snow le

  • Photoshop CC 64 bit sometimes won't recognize Nvidia graphics card

    Sometimes when I open Photoshop CC 64 bit on windows 8.1 I get these warnings. I then have to restart my laptop for Photoshop to recognize my graphics card. Sometimes when I launch photoshop it is fine and there is no issue at all. It seems like ever

  • Finally made the purchase!!!

    Well, I finally did it. I'm probably going to be sorry when they release a new imac next month, but I just couldn't wait any longer. Yesterday I ordered a new 20" imac 2GB of ram and the upgraded video card. Am I going to be sorry? I was wondering if

  • After reinstalling FFox and Adobe Flash Player, why will a certain company webpage will not load, but it does in IE.

    For some reason a certain corporate company web site will not load on my desktop PC. The page is gray and white with some headings and a circle in the middle that goes round and round. I previously (some months ago) was able to access the site (and h