Permalink
Browse files

Make a -march=native build by default

It's like 3% faster on my system, maybe.
  • Loading branch information...
1 parent f64b36f commit d4c0b812bafb49137d9f7512b5c919753565bcd2 @laverdet committed Mar 31, 2012
Showing with 10 additions and 4 deletions.
  1. +3 −0 Makefile
  2. +1 −1 package.json
  3. +1 −1 src/Makefile
  4. +5 −2 src/platform.mk
View
@@ -3,6 +3,9 @@ FIBERS_SO := $(shell echo `pwd`/src/fibers.node)
all: fibers test
+native:
+ FIBERS_NATIVE=1 make all
+
fibers: $(FIBERS_SO)
dist: man
View
@@ -8,7 +8,7 @@
"author": "Marcel Laverdet <marcel@laverdet.com> (https://github.com/laverdet/)",
"main": "fibers",
"scripts": {
- "install": "make clean all"
+ "install": "make clean native"
},
"man": "./man/fibers.1",
"repository": {
View
@@ -10,7 +10,7 @@ ifeq ($(NODE_PLATFORM), darwin)
CPP_NODEFLAGS = -bundle -undefined dynamic_lookup
endif
ifeq ($(NODE_PLATFORM), openbsd)
- CPP_NODEFLAGS = -fPIC -shared -Wl,-Bdynamic
+ CPP_NODEFLAGS = -fPIC -shared -Wl,-Bdynamic
endif
all: fibers.node
View
@@ -3,7 +3,10 @@ NODE_PREFIX := $(shell node -e "console.log(require('path').dirname(require('pat
NODE_PLATFORM := $(shell node -e "console.log(process.platform.replace('2', ''))")
NODE_BITS := $(shell node -e "console.log(process.arch.replace(/^(?:ia|x)/, ''))")
-CPPFLAGS = -Wall -Wno-deprecated-declarations -I$(NODE_PREFIX)/include -I$(NODE_PREFIX)/include/node
+CPPFLAGS += -Wall -Wno-deprecated-declarations -I$(NODE_PREFIX)/include -I$(NODE_PREFIX)/include/node
+ifdef FIBERS_NATIVE
+ CPPFLAGS += -march=native
+endif
ifdef DEBUG
CPPFLAGS += -ggdb -O0
else
@@ -40,5 +43,5 @@ ifeq ($(NODE_PLATFORM), darwin)
CPPFLAGS += -DCORO_SJLJ
endif
ifeq ($(NODE_PLATFORM), openbsd)
- CPPFLAGS += -DCORO_ASM
+ CPPFLAGS += -DCORO_ASM
endif

0 comments on commit d4c0b81

Please sign in to comment.