Jump to content

so i made a little one click CPU benchmark in java.

 

ready to run

post-142539-0-01575000-1429904060.png

 

running

post-142539-0-23371200-1429904089.png

 

done

post-142539-0-08467400-1429904107.png

 

 

you can get it here for free http://nathanlp.tumblr.com/Ccycler
if you use it post your score.

Brony for LIFE!!!

/)^3^(\ RD FTW
Daily carry: HTC one M8, pebbe steel PBD, nexus 7 2013

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/
Share on other sites

Link to post
Share on other sites

self advertising is against the CoC

Are you new to the forums???? read the Code of Conduct HERE WANT SOME AWESOME LTT THEMED WALLPAPERS??? check out XTanksSlayerX's wallpaper thread HERE 

"May our framerates be high, and our temperatures low" - PC MasterRace

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815090
Share on other sites

Link to post
Share on other sites

here is the code if you can read java

 

/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */package ccycler;import java.awt.Color;import java.awt.event.ActionEvent;import java.awt.event.ActionListener;import java.util.logging.Level;import java.util.logging.Logger;import javax.swing.*;/** * * @author nathan */public class CWin implements ActionListener {    int out=2;    int pro=0;    int st;    int fin;    int score;    boolean star=false;    JFrame window = new JFrame("Ccycler");    JPanel wall = new JPanel();    //JLabel output = new JLabel("output: "+out);    //JLabel progress = new JLabel("progress: "+pro+"/1000000");    JButton start = new JButton ("Run Benchmark");    JLabel scoreD = new JLabel("Score: "+score+" Lower Is Better.");    public CWin(){    window.setDefaultCloseOperation(window.EXIT_ON_CLOSE);    window.setVisible(true);    window.add(wall);    //wall.add(output);    //wall.add(progress);    wall.add(start);    wall.add(scoreD);    wall.setBackground(Color.red);    window.pack();    start.addActionListener((ActionListener) this);   }    public void actionPerformed(ActionEvent e){    if (e.getSource()==start){    System.out.println("test");    pro=0;    score=0;    star=true;    wall.updateUI();    scoreD.setText("Score: "+score+" Lower Is Better.");    wall.setBackground(Color.red);    wall.updateUI();        try {            Thread.sleep(3000);        } catch (InterruptedException ex) {            Logger.getLogger(CWin.class.getName()).log(Level.SEVERE, null, ex);        }    st=(int) System.currentTimeMillis()/1000;    while (pro < 1000000){        out=(int) (out/.2);        //output.setText("output: "+out);        pro=pro+1;        //progress.setText("progress: "+pro+"/1000000");        System.out.println(pro);        System.out.println(out);        wall.updateUI();        }    }    if (pro==1000000){    fin=(int) System.currentTimeMillis()/1000;    wall.setBackground(Color.green);    star=false;    score=fin-st;    System.out.println("score: "+score);    scoreD.setText("Score: "+score+" Lower Is Better.");    window.pack();    }    if (star==true){ start.setText("Benchmarking"); window.pack();}    else {start.setText("Run Benchmark"); window.pack();}    }    }
Edited by colonel_mortis
Added code tags

Brony for LIFE!!!

/)^3^(\ RD FTW
Daily carry: HTC one M8, pebbe steel PBD, nexus 7 2013

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815105
Share on other sites

Link to post
Share on other sites

I'm only getting a third CPU utilization with this...

-snip-

windows tends to do that in my testing.

-edit-

my linux box will only let it have one and a half cores.

Brony for LIFE!!!

/)^3^(\ RD FTW
Daily carry: HTC one M8, pebbe steel PBD, nexus 7 2013

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815115
Share on other sites

Link to post
Share on other sites

Yeah. Then how did you get 9 out of it on a Phenom II?

This would probably be my question, considering I scored a 57 at 4.4GHz.

Main Rig: CPU: AMD Ryzen 7 5700X3D | RAM: 32GB (2x16GB) KLEVV CRAS XR RGB DDR4-3600 | Motherboard: Gigabyte B550I AORUS PRO AX | Storage: 500GB Crucial P3 Plus, 4TB Silicon Power UD90 | GPU: AsRock Radeon RX 9070 XT Steel Legend | Cooling: ThermalTake Floe 280mm w/ be quiet! Pure Wings 3 | Case: Sliger SM580 (Black) | PSU: Corsair SF850

Main Server: CPU: AMD Ryzen 9 5950X | RAM: 64GB (2x32GB) Corsair Vengeance LPX DDR4-3200 | Motherboard: ASUS Crosshair VII Hero WiFi | Storage: 512GB SKHynix NVMe | GPUs: NVIDIA TITAN Xp 2-way SLI | Cooling: Thermalright Frozen Prism 360mm | Case: Corsair 5000D Airflow (White) | PSU: Seasonic Focus GM850

File and Media Server (AOOSTAR WTR Pro): CPU: AMD Ryzen 7 5825U | RAM: 32GB (2x16GB) Silicon Power DDR4-3200 SODIMMs | Storage: 1TB Samsung 970 EVO Plus, 2x14TB Western Digital Ultrastar DC HC530

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815130
Share on other sites

Link to post
Share on other sites

Yeah. Then how did you get 9 out of it on a Phenom II?

its still a WIP my laptop with an amd A6 got a 202 it looks like with the testing i have done on my systems that the OS plays a part in it.

Brony for LIFE!!!

/)^3^(\ RD FTW
Daily carry: HTC one M8, pebbe steel PBD, nexus 7 2013

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815153
Share on other sites

Link to post
Share on other sites

These kinds of tests need to be multi-threaded, and be optimized to avoid any branch mispredictions, otherwise parts of the CPU will be sitting there doing nothing.
Try spawning the same number of threads, as that there are cores/hardware threads, and do calculations doing that. That should give you a lot more precise indication of the CPU speed.

 

If you share your source code, we might be able to help you out writing something better.

EDIT:
turns out I can't read and you already uploaded your source code. You wanna get rid of all the debug print statements since those have IO delays.You don't want to update your UI on the same thread as you are bench marking, since you don't know what kind of code is behind that, and it might be doing some graphics driver stuff.

Also why do you check if pro == 1000000. It it guaranteed to be that value when you end that loop. 

NOTE: I have never written a CPU benchmark, but this is using some of my knowledge that I gathered over the years.
 

Link to comment
https://linustechtips.com/topic/354385-ccycler-a-cpu-benchmark/#findComment-4815190
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×