Optimized decimal and hex string parsing in hot path.

Using specialized and inline-able parsers instead of strtoul() improved
pixel throughput from ~63MB/s to ~83MB/s (+30%) on a single core
on my machine.

As a side effect, the PX command now allows any non-decimal
character as separator between parameters ¯\_(ツ)_/¯
This commit is contained in:
Marcel Hellkamp 2018-04-02 17:25:47 +02:00
parent b3b6c1c042
commit 1b36a66243
2 changed files with 66 additions and 26 deletions

View file

@ -1,15 +1,16 @@
.PHONY: default all clean
CC = gcc
CFLAGS = -Wall -pthread -O2
CFLAGS = -Wall -pthread
LIBS = -levent -levent_pthreads -lrt -lGL -lGLEW -lglfw
TARGET = pixelnuke
default: CFLAGS += -O2 -flto
default: $(TARGET)
all: default
debug: CFLAGS += -DDEBUG -g
debug: default
debug: $(TARGET)
OBJECTS = $(patsubst %.c, %.o, $(wildcard *.c))
HEADERS = $(wildcard *.h)