Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


Closed Thread
  Search this Thread
Old 11-10-2008, 04:54 PM   #1
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:
#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)" );
  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;
  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;
  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:
$ 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:

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!

Old 11-10-2008, 04:59 PM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984Reputation: 1984
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, 05:07 PM   #3
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
Closed. FUP:

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 03:14 PM
Kernel performance test (TICKS) zzaappp SUSE / openSUSE 2 11-10-2008 05:07 PM
performance test suite kadamsuvarna Linux - General 1 12-27-2006 10:48 PM
Test Hard Drive performance? voxel Linux - Hardware 7 09-07-2005 02:44 AM
how to test video card performance mashenka Linux - Hardware 3 12-30-2003 10:12 PM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 02:56 AM.

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