Added : Travis automated tests

and license
and readme
This commit is contained in:
Yann Collet 2014-07-10 22:44:08 +02:00
parent 70ba044ded
commit f0f007f042
6 changed files with 134 additions and 6 deletions

14
.travis.yml Normal file
View File

@ -0,0 +1,14 @@
language: c
compiler: gcc
script: make test
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq gcc-multilib
- sudo apt-get install -qq valgrind
env:
- XXH_TRAVIS_CI_ENV=-m32
- XXH_TRAVIS_CI_ENV=-m64
matrix:
fast_finish: true

24
LICENSE Normal file
View File

@ -0,0 +1,24 @@
xxHash Library
Copyright (c) 2012-2014, Yann Collet
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -24,7 +24,6 @@
# ################################################################
CC=gcc
#CFLAGS=-I. -std=c99 -Wall -W -Wundef -Wno-implicit-function-declaration
CFLAGS+= -I. -std=c99 -O3 -Wall -Wextra -Wundef -Wshadow
@ -35,6 +34,15 @@ else
EXT =.exe
endif
# Minimize test target for Travis CI's Build Matrix
ifeq ($(XXH_TRAVIS_CI_ENV),-m32)
TEST_TARGETS=test-32
else ifeq ($(XXH_TRAVIS_CI_ENV),-m64)
TEST_TARGETS=test-64
else
TEST_TARGETS=test-64 test-32
endif
default: xxHash
all: xxHash xxHash32
@ -45,5 +53,16 @@ xxHash: xxhash.c bench.c
xxHash32: xxhash.c bench.c
$(CC) -m32 $(CFLAGS) $^ -o $@$(EXT)
test: $(TEST_TARGETS)
test-64: xxHash
./xxHash Makefile
valgrind ./xxHash -i1 Makefile
test-32: xxHash32
./xxHash32 Makefile
clean:
rm -f core *.o xxHash$(EXT)
rm -f core *.o xxHash$(EXT) xxHash32$(EXT)

73
README.md Normal file
View File

@ -0,0 +1,73 @@
xxHash - Extremely fast hash algorithm
======================================
xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
It successfully passes the [SMHasher](http://code.google.com/p/smhasher/wiki/SMHasher) Test suite evaluating Hash quality.
|Branch |Status |
|------------|---------|
|master | [![Build Status](https://travis-ci.org/Cyan4973/lz4.svg?branch=master)](https://travis-ci.org/Cyan4973/xxhash) |
|dev | [![Build Status](https://travis-ci.org/Cyan4973/lz4.svg?branch=dev)](https://travis-ci.org/Cyan4973/xxhash) |
Benchmarks
-------------------------
The benchmark uses SMHasher speed test, compiled with Visual on a Windows Seven 32 bits system.
The reference system uses a Core 2 Duo @3GHz
<table>
<tr>
<th>Name</th><th>Speed</th><th>Q.Score</th><th>Author</th>
</tr>
<tr>
<th>xxHash</th><th>5.4 GB/s</th><th>10</th><th>Y.C.</th>
</tr>
<tr>
<th>MumurHash 3a</th><th>2.7 GB/s</th><th>10</th><th>Austin Appleby</th>
</tr>
<tr>
<th>SBox</th><th>1.4 GB/s</th><th>9</th><th>Bret Mulvey</th>
</tr>
<tr>
<th>Lookup3</th><th>1.2 GB/s</th><th>9</th><th>Bob Jenkins</th>
</tr>
<tr>
<th>CityHash64</th><th>1.05 GB/s</th><th>10</th><th>Pike & Alakuijala</th>
</tr>
<tr>
<th>FNV</th><th>0.55 GB/s</th><th>5</th><th>Fowler, Noll, Vo</th>
</tr>
<tr>
<th>CRC32</th><th>0.43 GB/s</th><th>9</th><th></th>
</tr>
<tr>
<th>MD5-32</th><th>0.33 GB/s</th><th>10</th><th>Ronald L. Rivest</th>
</tr>
<tr>
<th>SHA1-32</th><th>0.28 GB/s</th><th>10</th><th></th>
</tr>
</table>
Q.Score is a measure of quality of the hash function.
It depends on successfully passing SMHasher test set.
10 is a perfect score.
A new version, XXH64, has been created thanks to Mathias Westerdahl contribution, which offers superior speed and dispersion on 64-bits systems.
SMHasher speed test, compiled GCC 4.6.1, a Linux 64-bits system.
The reference system uses a Core i5-3340M @2.7GHz
| Version | Speed on 64-bits | Speed on 32-bits |
|------------|------------------|------------------|
| XXH64 | 13.8 GB/s | 1.9 GB/s |
| XXH32 | 6.8 GB/s | 6.0 GB/s |
|------------|------------------|------------------|
This is an official mirror of xxHash project, [hosted on Google Code](http://code.google.com/p/xxhash/).
The intention is to offer github's capabilities to xxHash users, such as cloning, branch, or source download.
The "master" branch will reflect, the status of xxHash at its official homepage. Other branches will also exist, typically to fix some open issues or new requirements, and be available for testing before merge into master.

View File

@ -106,7 +106,6 @@ unsigned int XXH64_32(const void* key, int len, unsigned int seed)
//**************************************
// Local structures
//**************************************
struct hashFunctionPrototype
{
unsigned int (*hashFunction)(const void*, int, unsigned int);
@ -487,8 +486,8 @@ static void BMK_sanityCheck()
BMK_testSequence64(sanityBuffer, SANITY_BUFFER_SIZE, 0, 0x0EAB543384F878ADULL);
BMK_testSequence64(sanityBuffer, SANITY_BUFFER_SIZE, PRIME, 0xCAA65939306F1E21ULL);
DISPLAY(" -- all tests ok");
DISPLAY("\r%79s\r", ""); // Clean display line
DISPLAY("Sanity check -- all tests ok\n");
}
@ -564,4 +563,3 @@ int main(int argc, char** argv)
return BMK_benchFile(argv+filenamesStart, argc-filenamesStart, fn_selection);
}

View File

@ -1,5 +1,5 @@
/*
xxHash - Fast Hash algorithm
xxHash - Extremely Fast Hash algorithm
Header File
Copyright (C) 2012-2014, Yann Collet.
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)