mirror of
https://github.com/Alcaro/Flips.git
synced 2026-09-08 10:35:11 -05:00
Misc cleanups, add performance regression test
This commit is contained in:
27
Makefile
27
Makefile
@@ -19,6 +19,10 @@ SOURCES := *.cpp
|
||||
|
||||
PREFIX ?= /usr
|
||||
|
||||
ifeq ($(TARGET),win)
|
||||
override TARGET := windows
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
targetmachine := $(shell $(CXX) -dumpmachine)
|
||||
ifneq ($(findstring mingw,$(targetmachine)),)
|
||||
@@ -30,10 +34,6 @@ ifeq ($(TARGET),)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),win)
|
||||
override TARGET := windows
|
||||
endif
|
||||
|
||||
ifeq ($(TARGET),)
|
||||
uname := $(shell uname -a)
|
||||
ifeq ($(uname),)
|
||||
@@ -79,22 +79,9 @@ endif
|
||||
MOREFLAGS := $(CFLAGS_$(TARGET))
|
||||
|
||||
|
||||
ifneq ($(DIVSUF),no)
|
||||
DIVSUF_EXIST := $(lastword $(wildcard libdivsufsort-2*/include/config.h))
|
||||
DIVSUF := $(subst /include/config.h,,$(DIVSUF_EXIST))
|
||||
ifneq ($(DIVSUF),)
|
||||
DIVSUF_SOURCES := $(filter-out %/utils.c,$(wildcard $(DIVSUF)/lib/*.c))
|
||||
DIVSUF_CFLAGS := -I$(DIVSUF)/include -DHAVE_CONFIG_H -D__STDC_FORMAT_MACROS
|
||||
DIVSUF_LFLAGS :=
|
||||
MOREFLAGS += $(DIVSUF_CFLAGS) $(DIVSUF_SOURCES) $(DIVSUF_LFLAGS)
|
||||
else
|
||||
$(warning no libdivsufsort-2.x detected; switching to fallback libdivsufsort-lite)
|
||||
$(warning libdivsufsort is approximately 3% faster than lite)
|
||||
SOURCES += divsufsort.c
|
||||
endif
|
||||
else
|
||||
SOURCES += divsufsort.c
|
||||
endif
|
||||
DIVSUF := libdivsufsort-2.0.1
|
||||
SOURCES += $(DIVSUF)/lib/divsufsort.c $(DIVSUF)/lib/sssort.c $(DIVSUF)/lib/trsort.c
|
||||
MOREFLAGS += -I$(DIVSUF)/include -DHAVE_CONFIG_H -D__STDC_FORMAT_MACROS
|
||||
|
||||
ifeq ($(TARGET),gtk)
|
||||
CFLAGS_G += -fopenmp
|
||||
|
||||
6
configure
vendored
6
configure
vendored
@@ -1,12 +1,12 @@
|
||||
#!/bin/sh
|
||||
|
||||
# This script does nothing, other than trick people into running it.
|
||||
# Since it's usually run before make, and people tend to read its output
|
||||
# This script does nothing, other than trick people into running it and print the manual.
|
||||
# Since configure is usually run before make, and people tend to read its output
|
||||
# (to find which dependencies are missing), it's the best place to put compilation instructions.
|
||||
cat <<EOF
|
||||
To compile Floating IPS in release mode (recommended for most users; will take a
|
||||
few minutes, but result will be fast), use \`./make.sh'.
|
||||
To compile Floating IPS in almost-release mode (3% slower at runtime, but only
|
||||
To compile Floating IPS in almost-release mode (2% slower at runtime, but only
|
||||
takes a few seconds to compile), use \`./make.sh --profile=no'.
|
||||
To compile Floating IPS in debug mode (NOT recommended unless you're tracking a
|
||||
bug, it's VERY slow for big files), use \`make'.
|
||||
|
||||
@@ -122,7 +122,6 @@
|
||||
//I'd prefer to let them allocate from an array I give it, but divsuf doesn't allow that, and there
|
||||
// are only half a dozen allocations per call anyways.
|
||||
|
||||
//This ends up in libdivsufsort if available, otherwise lite.
|
||||
#include "divsufsort.h"
|
||||
static void sufsort(int32_t* SA, uint8_t* T, int32_t n)
|
||||
{
|
||||
|
||||
@@ -42,7 +42,7 @@ objdump -p flips.exe | grep 'DLL Name' | \
|
||||
|
||||
#test cli binaries
|
||||
echo "CLI"
|
||||
make TARGET=cli DIVSUF=no
|
||||
make TARGET=cli
|
||||
[ -e flips ] || exit
|
||||
rm flips
|
||||
|
||||
@@ -55,4 +55,7 @@ echo Size: $(stat -c%s flips.exe)/155648
|
||||
echo \(Linux: $(stat -c%s ~/bin/flips)\)
|
||||
echo \(Zipped: $(stat -c%s floating.zip)/59881\)
|
||||
|
||||
/usr/bin/time --format='time: %E' flips --create --bps-delta sm64.z64 star.z64 /dev/null > /dev/null
|
||||
echo 'expected: 0:04.56'
|
||||
|
||||
#./special.sh
|
||||
|
||||
2
make.sh
2
make.sh
@@ -41,8 +41,8 @@ if [ $PROFILE = yes ]; then
|
||||
echo 'GTK+ (1/3)'
|
||||
rm obj/* flips; TARGET=gtk make CFLAGS="$FLAGS$LINFLAGS -fprofile-generate -lgcov" || exit $?
|
||||
[ -e flips ] || exit 1
|
||||
echo 'GTK+ (2/3)'
|
||||
|
||||
echo 'GTK+ (2/3)'
|
||||
# These files are downloaded and extracted from
|
||||
# https://ftp.mozilla.org/pub/firefox/releases/10.0esr/linux-x86_64/en-US/firefox-10.0esr.tar.bz2
|
||||
# https://ftp.mozilla.org/pub/firefox/releases/17.0esr/linux-x86_64/en-US/firefox-17.0esr.tar.bz2
|
||||
|
||||
Reference in New Issue
Block a user