https://github.com/gamemann/performance-test-program
A small program that acts as a C profiler.
https://github.com/gamemann/performance-test-program
c performance profile profiling
Last synced: over 1 year ago
JSON representation
A small program that acts as a C profiler.
- Host: GitHub
- URL: https://github.com/gamemann/performance-test-program
- Owner: gamemann
- Created: 2021-11-11T04:32:04.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-11-12T04:57:14.000Z (over 4 years ago)
- Last Synced: 2025-02-28T12:30:02.426Z (over 1 year ago)
- Topics: c, performance, profile, profiling
- Language: C
- Homepage: https://moddingcommunity.com/
- Size: 3.91 KB
- Stars: 11
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Performance Test
## Description
This is a simple program in C for performance testing which only works for x86 and x86_64 systems. A `for` loop is executed *x* times and we use the Assembly instruction `rdtsc` for profiling.
## Test 1
Test #1 simply creates a character array with a size of 256 bytes and a string value of "a string" is copied to the character array via `strcpy()`. Afterwards, a variable representing the profiling average along with the highest and lowest profile speeds are calculated.
## Command Line
There is currently only one command line argument which may be found below.
```
-c --count => The amount of times to execute for/while loops.
```
### Example
```
./perftest1 -c 10000000
```
## Building And Installing
You can use `git` and `make` to build and install the program.
```
git clone https://github.com/gamemann/Performance-Test-Program.git
cd Performance-Test-Program/
sudo make && sudo make install
```
The binary `perftest1` will be copied to `/usr/bin`. Therefore, it should be added to your path (e.g. you can write `perftest1 ...`).
## Credits
* [Christian Deacon](https://github.com/gamemann)