LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Closed Thread
 
Search this Thread
Old 11-10-2008, 03:54 PM   #1
zzaappp
LQ Newbie
 
Registered: Jun 2008
Posts: 5

Rep: Reputation: 0
Kernel performance test (the TICKS test)


I have a performance test I've been running against a collection of kernels in order to find the fastest commercially provided distro out there. So far the fastest I've found has been the Gentoo distro, but that one can take a lot of effort to set up on new hardware.

I wrote a TICKS test to examine how fast and accurate the kernel is at waking up processes from a sleeping state.

Here is the code to ticks.c:
Code:
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#include <sys/time.h>
#include <sys/timeb.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/times.h>
#include <signal.h>

#include <errno.h>

unsigned long milsec(void)
{
  struct timeval  tv;
  struct timezone tz;

  if( gettimeofday( &tv,&tz ) == -1 )
    return( 0 );
  return( tv.tv_usec + (tv.tv_sec*1000*1000));
}

const char* uname(void)
{
  static char  buff[1024];
  FILE*        fp=fopen("/proc/version","r");

  if( fp==NULL )
    return( "(OS unknown)" );
  fgets(buff,sizeof(buff),fp);
  return( buff );
}

int main(int argc,char *argv[])
{
  volatile char           B1[102400];
  volatile char           B2[102400];
  volatile unsigned long  Start,Stop;
  volatile int            count,max=1000,index;
  struct timeval          tv;
  struct timespec         tvp;

  if( argc >=2 ) 
    max = atoi(argv[1]);

  printf("OS:  %s\n",uname());
  Start = milsec();
  for(count=0; count<max; ++count)
  {
    tv.tv_sec  = 0;
    tv.tv_usec = 1;
    select(0,NULL,NULL,NULL,&tv);
  }
  Stop  = milsec();
  printf("TICK  :  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));

  Start = milsec();
  for(count=0; count<max; ++count)
  {
    tvp.tv_sec  = 0;
    tvp.tv_nsec = 1;
    pselect(0,NULL,NULL,NULL,&tvp,NULL);
  }
  Stop  = milsec();
  printf("TICKp :  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));

  ////////////////////////////////////////
  // BENCH of memcpy/indexing
  ////////////////////////////////////////
  
  Start = milsec();
  for(count=0; count<max; ++count)
  {
    for(index=0; index<sizeof(B1); ++index)
      B2[index] = B1[index];
  }
  Stop  = milsec();
  printf("MEMCPY:  Iterations[%d] Delta[%10lu] Avg[%7.3f]\n",max,Stop-Start,(double)(Stop-Start)/(double)(max));
}
If you save the above code snippet into the file, ticks.c, you can then build and run it with:
Code:
$ gcc ticks.c
$ a.out
I was hoping some Slackware folks out there could run this and add your results to this thread so I can know how the different permutations of the Slackware distro perform. To start, here are my Gentoo stats:

Quote:
Linux foghorn 2.6.20-gentoo-r8 #1 Tue Jul 17 10:48:20 EDT 2007 x86_64 AMD Athlon(tm) 64 FX-55 Processor AuthenticAMD GNU/Linux
TICKS : Iterations[1000] Delta[ 255] Avg[ 0.255]
I really appreciate any assistance with this!

-z
 
Old 11-10-2008, 03:59 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
 
Old 11-10-2008, 04:07 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,457
Blog Entries: 54

Rep: Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897Reputation: 2897
Closed. FUP: http://www.linuxquestions.org/questi...s-test-682453/
 
  


Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Performance test of kernel (TICKS test) zzaappp Linux - Distributions 7 12-09-2008 02:14 PM
Kernel performance test (TICKS) zzaappp Suse/Novell 2 11-10-2008 04:07 PM
performance test suite kadamsuvarna Linux - General 1 12-27-2006 09:48 PM
Test Hard Drive performance? voxel Linux - Hardware 7 09-07-2005 01:44 AM
how to test video card performance mashenka Linux - Hardware 3 12-30-2003 09:12 PM


All times are GMT -5. The time now is 06:32 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration