2011-03-19 06:37:00 +08:00
|
|
|
# Copyright (c) 2011 The LevelDB Authors. All rights reserved.
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file. See the AUTHORS file for names of contributors.
|
|
|
|
|
2011-06-02 08:00:37 +08:00
|
|
|
#-----------------------------------------------
|
|
|
|
# Uncomment exactly one of the lines labelled (A), (B), and (C) below
|
|
|
|
# to switch between compilation modes.
|
|
|
|
|
2014-09-17 05:19:52 +08:00
|
|
|
# (A) Production use (optimized mode)
|
|
|
|
OPT ?= -O2 -DNDEBUG
|
|
|
|
# (B) Debug mode, w/ full line-level debugging symbols
|
|
|
|
# OPT ?= -g2
|
|
|
|
# (C) Profiling mode: opt, but w/debugging symbols
|
|
|
|
# OPT ?= -O2 -g2 -DNDEBUG
|
2011-06-02 08:00:37 +08:00
|
|
|
#-----------------------------------------------
|
|
|
|
|
2011-06-29 08:30:50 +08:00
|
|
|
# detect what platform we're building on
|
2013-05-15 07:52:56 +08:00
|
|
|
$(shell CC="$(CC)" CXX="$(CXX)" TARGET_OS="$(TARGET_OS)" \
|
2012-10-13 02:53:12 +08:00
|
|
|
./build_detect_platform build_config.mk ./)
|
2012-04-17 23:36:46 +08:00
|
|
|
# this file is generated by the previous line to set build flags and sources
|
2011-06-29 08:30:50 +08:00
|
|
|
include build_config.mk
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
TESTS = \
|
|
|
|
db/autocompact_test \
|
|
|
|
db/c_test \
|
|
|
|
db/corruption_test \
|
|
|
|
db/db_test \
|
|
|
|
db/dbformat_test \
|
|
|
|
db/fault_injection_test \
|
|
|
|
db/filename_test \
|
|
|
|
db/log_test \
|
|
|
|
db/recovery_test \
|
|
|
|
db/skiplist_test \
|
|
|
|
db/version_edit_test \
|
|
|
|
db/version_set_test \
|
|
|
|
db/write_batch_test \
|
|
|
|
helpers/memenv/memenv_test \
|
|
|
|
issues/issue178_test \
|
|
|
|
issues/issue200_test \
|
|
|
|
table/filter_block_test \
|
|
|
|
table/table_test \
|
|
|
|
util/arena_test \
|
|
|
|
util/bloom_test \
|
|
|
|
util/cache_test \
|
|
|
|
util/coding_test \
|
|
|
|
util/crc32c_test \
|
2017-03-02 04:05:47 +08:00
|
|
|
util/env_posix_test \
|
2016-01-30 07:58:37 +08:00
|
|
|
util/env_test \
|
|
|
|
util/hash_test
|
|
|
|
|
|
|
|
UTILS = \
|
|
|
|
db/db_bench \
|
|
|
|
db/leveldbutil
|
|
|
|
|
|
|
|
# Put the object files in a subdirectory, but the application at the top of the object dir.
|
|
|
|
PROGNAMES := $(notdir $(TESTS) $(UTILS))
|
|
|
|
|
|
|
|
# On Linux may need libkyotocabinet-dev for dependency.
|
|
|
|
BENCHMARKS = \
|
|
|
|
doc/bench/db_bench_sqlite3 \
|
|
|
|
doc/bench/db_bench_tree_db
|
|
|
|
|
2012-03-31 04:15:49 +08:00
|
|
|
CFLAGS += -I. -I./include $(PLATFORM_CCFLAGS) $(OPT)
|
|
|
|
CXXFLAGS += -I. -I./include $(PLATFORM_CXXFLAGS) $(OPT)
|
2011-06-29 08:30:50 +08:00
|
|
|
|
2012-03-22 01:28:03 +08:00
|
|
|
LDFLAGS += $(PLATFORM_LDFLAGS)
|
2012-10-17 07:17:53 +08:00
|
|
|
LIBS += $(PLATFORM_LIBS)
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
SIMULATOR_OUTDIR=out-ios-x86
|
|
|
|
DEVICE_OUTDIR=out-ios-arm
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2014-09-17 05:19:52 +08:00
|
|
|
ifeq ($(PLATFORM), IOS)
|
2016-01-30 07:58:37 +08:00
|
|
|
# Note: iOS should probably be using libtool, not ar.
|
2014-09-17 05:19:52 +08:00
|
|
|
AR=xcrun ar
|
2016-01-30 07:58:37 +08:00
|
|
|
SIMULATORSDK=$(shell xcrun -sdk iphonesimulator --show-sdk-path)
|
|
|
|
DEVICESDK=$(shell xcrun -sdk iphoneos --show-sdk-path)
|
|
|
|
DEVICE_CFLAGS = -isysroot "$(DEVICESDK)" -arch armv6 -arch armv7 -arch armv7s -arch arm64
|
|
|
|
SIMULATOR_CFLAGS = -isysroot "$(SIMULATORSDK)" -arch i686 -arch x86_64
|
|
|
|
STATIC_OUTDIR=out-ios-universal
|
|
|
|
else
|
|
|
|
STATIC_OUTDIR=out-static
|
|
|
|
SHARED_OUTDIR=out-shared
|
|
|
|
STATIC_PROGRAMS := $(addprefix $(STATIC_OUTDIR)/, $(PROGNAMES))
|
2017-10-05 02:26:45 +08:00
|
|
|
SHARED_PROGRAMS := $(addprefix $(SHARED_OUTDIR)/, db_bench c_test)
|
2014-09-17 05:19:52 +08:00
|
|
|
endif
|
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
STATIC_LIBOBJECTS := $(addprefix $(STATIC_OUTDIR)/, $(SOURCES:.cc=.o))
|
|
|
|
STATIC_MEMENVOBJECTS := $(addprefix $(STATIC_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))
|
|
|
|
|
|
|
|
DEVICE_LIBOBJECTS := $(addprefix $(DEVICE_OUTDIR)/, $(SOURCES:.cc=.o))
|
|
|
|
DEVICE_MEMENVOBJECTS := $(addprefix $(DEVICE_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))
|
|
|
|
|
|
|
|
SIMULATOR_LIBOBJECTS := $(addprefix $(SIMULATOR_OUTDIR)/, $(SOURCES:.cc=.o))
|
|
|
|
SIMULATOR_MEMENVOBJECTS := $(addprefix $(SIMULATOR_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))
|
|
|
|
|
|
|
|
SHARED_LIBOBJECTS := $(addprefix $(SHARED_OUTDIR)/, $(SOURCES:.cc=.o))
|
|
|
|
SHARED_MEMENVOBJECTS := $(addprefix $(SHARED_OUTDIR)/, $(MEMENV_SOURCES:.cc=.o))
|
|
|
|
|
|
|
|
TESTUTIL := $(STATIC_OUTDIR)/util/testutil.o
|
|
|
|
TESTHARNESS := $(STATIC_OUTDIR)/util/testharness.o $(TESTUTIL)
|
Replace SSE-optimized CRC32C in POSIX port with external library.
Maintaining a hardware-accelerated CRC32C implementation tailored for
all modern platforms deserves a repository of its own. We extracted the
implementation here into https://github.com/google/crc32c and improved
it in that repository. This CL removes the SSE-optimized implementation
from this codebase, and adds the ability to use the google/crc32c
library, if it is present on the system.
The benchmarks below show the performance impact of the change. In
summary, open source builds that use the google/crc32c library can
expect a 3x improvement in CRC32C throughput, whereas builds that do not
use the library will see a 50% drop in CRC32C throughput. This
translates in much smaller changes in overall leveldb performance.
Baseline, MacBookPro13,3 with Core i7 6920HQ:
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 3.064 micros/op; 36.1 MB/s
fillsync : 57.861 micros/op; 1.9 MB/s (1000 ops)
fillrandom : 3.887 micros/op; 28.5 MB/s
overwrite : 4.140 micros/op; 26.7 MB/s
readrandom : 7.433 micros/op; (1000000 of 1000000 found)
readrandom : 6.825 micros/op; (1000000 of 1000000 found)
readseq : 0.244 micros/op; 453.4 MB/s
readreverse : 0.387 micros/op; 285.8 MB/s
compact : 449707.000 micros/op;
readrandom : 4.196 micros/op; (1000000 of 1000000 found)
readseq : 0.228 micros/op; 485.8 MB/s
readreverse : 0.320 micros/op; 345.2 MB/s
fill100K : 562.556 micros/op; 169.6 MB/s (1000 ops)
crc32c : 0.768 micros/op; 5085.0 MB/s (4K per op)
snappycomp : 4.220 micros/op; 925.7 MB/s (output: 55.1%)
snappyuncomp : 0.635 micros/op; 6155.7 MB/s
acquireload : 13.054 micros/op; (each op is 1000 loads)
New with crc32c, MacBookPro13,3 with Core i7 6920HQ:
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 2.820 micros/op; 39.2 MB/s
fillsync : 51.988 micros/op; 2.1 MB/s (1000 ops)
fillrandom : 3.747 micros/op; 29.5 MB/s
overwrite : 4.047 micros/op; 27.3 MB/s
readrandom : 7.287 micros/op; (1000000 of 1000000 found)
readrandom : 6.927 micros/op; (1000000 of 1000000 found)
readseq : 0.253 micros/op; 437.5 MB/s
readreverse : 0.411 micros/op; 269.2 MB/s
compact : 440405.000 micros/op;
readrandom : 4.159 micros/op; (1000000 of 1000000 found)
readseq : 0.230 micros/op; 481.1 MB/s
readreverse : 0.320 micros/op; 345.9 MB/s
fill100K : 558.222 micros/op; 170.9 MB/s (1000 ops)
crc32c : 0.214 micros/op; 18263.5 MB/s (4K per op)
snappycomp : 4.471 micros/op; 873.7 MB/s (output: 55.1%)
snappyuncomp : 0.833 micros/op; 4688.5 MB/s
acquireload : 13.289 micros/op; (each op is 1000 loads)
New without crc32c, MacBookPro13,3 with Core i7 6920HQ
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 3.094 micros/op; 35.8 MB/s
fillsync : 52.160 micros/op; 2.1 MB/s (1000 ops)
fillrandom : 4.090 micros/op; 27.0 MB/s
overwrite : 4.006 micros/op; 27.6 MB/s
readrandom : 6.584 micros/op; (1000000 of 1000000 found)
readrandom : 6.676 micros/op; (1000000 of 1000000 found)
readseq : 0.280 micros/op; 395.2 MB/s
readreverse : 0.391 micros/op; 283.2 MB/s
compact : 433911.000 micros/op;
readrandom : 4.261 micros/op; (1000000 of 1000000 found)
readseq : 0.251 micros/op; 440.5 MB/s
readreverse : 0.356 micros/op; 310.9 MB/s
fill100K : 584.023 micros/op; 163.3 MB/s (1000 ops)
crc32c : 1.384 micros/op; 2822.3 MB/s (4K per op)
snappycomp : 4.763 micros/op; 820.1 MB/s (output: 55.1%)
snappyuncomp : 0.766 micros/op; 5098.6 MB/s
acquireload : 12.931 micros/op; (each op is 1000 loads)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171667771
2017-10-10 21:05:17 +08:00
|
|
|
TEST_STATIC_OBJS := $(STATIC_OUTDIR)/port/port_posix.o $(STATIC_OUTDIR)/util/crc32c.o $(STATIC_OUTDIR)/util/histogram.o
|
2016-01-30 07:58:37 +08:00
|
|
|
|
|
|
|
STATIC_TESTOBJS := $(addprefix $(STATIC_OUTDIR)/, $(addsuffix .o, $(TESTS)))
|
|
|
|
STATIC_UTILOBJS := $(addprefix $(STATIC_OUTDIR)/, $(addsuffix .o, $(UTILS)))
|
|
|
|
STATIC_ALLOBJS := $(STATIC_LIBOBJECTS) $(STATIC_MEMENVOBJECTS) $(STATIC_TESTOBJS) $(STATIC_UTILOBJS) $(TESTHARNESS)
|
|
|
|
DEVICE_ALLOBJS := $(DEVICE_LIBOBJECTS) $(DEVICE_MEMENVOBJECTS)
|
|
|
|
SIMULATOR_ALLOBJS := $(SIMULATOR_LIBOBJECTS) $(SIMULATOR_MEMENVOBJECTS)
|
2011-05-28 08:53:58 +08:00
|
|
|
|
2012-03-31 04:15:49 +08:00
|
|
|
default: all
|
|
|
|
|
|
|
|
# Should we build shared libraries?
|
|
|
|
ifneq ($(PLATFORM_SHARED_EXT),)
|
2012-05-31 00:45:46 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
# Many leveldb test apps use non-exported API's. Only build a subset for testing.
|
|
|
|
SHARED_ALLOBJS := $(SHARED_LIBOBJECTS) $(SHARED_MEMENVOBJECTS) $(TESTHARNESS)
|
2017-10-05 02:26:45 +08:00
|
|
|
SHARED_CXXFLAGS += -DLEVELDB_SHARED_LIBRARY
|
|
|
|
SHARED_BUILD_CXXFLAGS += $(SHARED_CXXFLAGS) -DLEVELDB_COMPILE_LIBRARY
|
2016-01-30 07:58:37 +08:00
|
|
|
|
2012-05-31 00:45:46 +08:00
|
|
|
ifneq ($(PLATFORM_SHARED_VERSIONED),true)
|
2016-01-30 07:58:37 +08:00
|
|
|
SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)
|
|
|
|
SHARED_LIB2 = $(SHARED_LIB1)
|
|
|
|
SHARED_LIB3 = $(SHARED_LIB1)
|
|
|
|
SHARED_LIBS = $(SHARED_LIB1)
|
|
|
|
SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a
|
2012-05-31 00:45:46 +08:00
|
|
|
else
|
2012-03-31 04:15:49 +08:00
|
|
|
# Update db.h if you change these.
|
2016-01-30 07:58:37 +08:00
|
|
|
SHARED_VERSION_MAJOR = 1
|
2017-03-02 07:14:49 +08:00
|
|
|
SHARED_VERSION_MINOR = 20
|
2016-01-30 07:58:37 +08:00
|
|
|
SHARED_LIB1 = libleveldb.$(PLATFORM_SHARED_EXT)
|
|
|
|
SHARED_LIB2 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR)
|
|
|
|
SHARED_LIB3 = $(SHARED_LIB1).$(SHARED_VERSION_MAJOR).$(SHARED_VERSION_MINOR)
|
|
|
|
SHARED_LIBS = $(SHARED_OUTDIR)/$(SHARED_LIB1) $(SHARED_OUTDIR)/$(SHARED_LIB2) $(SHARED_OUTDIR)/$(SHARED_LIB3)
|
|
|
|
$(SHARED_OUTDIR)/$(SHARED_LIB1): $(SHARED_OUTDIR)/$(SHARED_LIB3)
|
|
|
|
ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB1)
|
|
|
|
$(SHARED_OUTDIR)/$(SHARED_LIB2): $(SHARED_OUTDIR)/$(SHARED_LIB3)
|
|
|
|
ln -fs $(SHARED_LIB3) $(SHARED_OUTDIR)/$(SHARED_LIB2)
|
|
|
|
SHARED_MEMENVLIB = $(SHARED_OUTDIR)/libmemenv.a
|
2012-03-31 04:15:49 +08:00
|
|
|
endif
|
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/$(SHARED_LIB3): $(SHARED_LIBOBJECTS)
|
|
|
|
$(CXX) $(LDFLAGS) $(PLATFORM_SHARED_LDFLAGS)$(SHARED_LIB2) $(SHARED_LIBOBJECTS) -o $(SHARED_OUTDIR)/$(SHARED_LIB3) $(LIBS)
|
2012-05-31 00:45:46 +08:00
|
|
|
|
|
|
|
endif # PLATFORM_SHARED_EXT
|
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
all: $(SHARED_LIBS) $(SHARED_PROGRAMS) $(STATIC_OUTDIR)/libleveldb.a $(STATIC_OUTDIR)/libmemenv.a $(STATIC_PROGRAMS)
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
check: $(STATIC_PROGRAMS)
|
|
|
|
for t in $(notdir $(TESTS)); do echo "***** Running $$t"; $(STATIC_OUTDIR)/$$t || exit 1; done
|
2011-03-19 06:37:00 +08:00
|
|
|
|
|
|
|
clean:
|
2016-01-30 07:58:37 +08:00
|
|
|
-rm -rf out-static out-shared out-ios-x86 out-ios-arm out-ios-universal
|
|
|
|
-rm -f build_config.mk
|
|
|
|
-rm -rf ios-x86 ios-arm
|
2011-05-28 08:53:58 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR):
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/db: | $(STATIC_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/helpers/memenv: | $(STATIC_OUTDIR)
|
|
|
|
mkdir -p $@
|
2011-07-27 09:46:25 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/port: | $(STATIC_OUTDIR)
|
|
|
|
mkdir $@
|
2011-07-27 09:46:25 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/table: | $(STATIC_OUTDIR)
|
|
|
|
mkdir $@
|
2012-12-28 02:38:48 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/util: | $(STATIC_OUTDIR)
|
|
|
|
mkdir $@
|
2013-08-22 02:12:47 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
.PHONY: STATIC_OBJDIRS
|
|
|
|
STATIC_OBJDIRS: \
|
|
|
|
$(STATIC_OUTDIR)/db \
|
|
|
|
$(STATIC_OUTDIR)/port \
|
|
|
|
$(STATIC_OUTDIR)/table \
|
|
|
|
$(STATIC_OUTDIR)/util \
|
|
|
|
$(STATIC_OUTDIR)/helpers/memenv
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR):
|
|
|
|
mkdir $@
|
2012-04-17 23:36:46 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/db: | $(SHARED_OUTDIR)
|
|
|
|
mkdir $@
|
2011-08-06 04:40:49 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/helpers/memenv: | $(SHARED_OUTDIR)
|
|
|
|
mkdir -p $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/port: | $(SHARED_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/table: | $(SHARED_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SHARED_OUTDIR)/util: | $(SHARED_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
.PHONY: SHARED_OBJDIRS
|
|
|
|
SHARED_OBJDIRS: \
|
|
|
|
$(SHARED_OUTDIR)/db \
|
|
|
|
$(SHARED_OUTDIR)/port \
|
|
|
|
$(SHARED_OUTDIR)/table \
|
|
|
|
$(SHARED_OUTDIR)/util \
|
|
|
|
$(SHARED_OUTDIR)/helpers/memenv
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR):
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/db: | $(DEVICE_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/helpers/memenv: | $(DEVICE_OUTDIR)
|
|
|
|
mkdir -p $@
|
2014-12-11 23:59:38 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/port: | $(DEVICE_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/table: | $(DEVICE_OUTDIR)
|
|
|
|
mkdir $@
|
2012-04-17 23:36:46 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/util: | $(DEVICE_OUTDIR)
|
|
|
|
mkdir $@
|
2014-09-17 05:19:52 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
.PHONY: DEVICE_OBJDIRS
|
|
|
|
DEVICE_OBJDIRS: \
|
|
|
|
$(DEVICE_OUTDIR)/db \
|
|
|
|
$(DEVICE_OUTDIR)/port \
|
|
|
|
$(DEVICE_OUTDIR)/table \
|
|
|
|
$(DEVICE_OUTDIR)/util \
|
|
|
|
$(DEVICE_OUTDIR)/helpers/memenv
|
2013-06-14 07:14:06 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR):
|
|
|
|
mkdir $@
|
2013-09-20 04:42:22 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/db: | $(SIMULATOR_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/helpers/memenv: | $(SIMULATOR_OUTDIR)
|
|
|
|
mkdir -p $@
|
2014-12-12 00:13:18 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/port: | $(SIMULATOR_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/table: | $(SIMULATOR_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/util: | $(SIMULATOR_OUTDIR)
|
|
|
|
mkdir $@
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
.PHONY: SIMULATOR_OBJDIRS
|
|
|
|
SIMULATOR_OBJDIRS: \
|
|
|
|
$(SIMULATOR_OUTDIR)/db \
|
|
|
|
$(SIMULATOR_OUTDIR)/port \
|
|
|
|
$(SIMULATOR_OUTDIR)/table \
|
|
|
|
$(SIMULATOR_OUTDIR)/util \
|
|
|
|
$(SIMULATOR_OUTDIR)/helpers/memenv
|
2011-06-22 10:36:45 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_ALLOBJS): | STATIC_OBJDIRS
|
|
|
|
$(DEVICE_ALLOBJS): | DEVICE_OBJDIRS
|
|
|
|
$(SIMULATOR_ALLOBJS): | SIMULATOR_OBJDIRS
|
|
|
|
$(SHARED_ALLOBJS): | SHARED_OBJDIRS
|
2011-03-19 06:37:00 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
ifeq ($(PLATFORM), IOS)
|
|
|
|
$(DEVICE_OUTDIR)/libleveldb.a: $(DEVICE_LIBOBJECTS)
|
2011-09-12 17:21:10 +08:00
|
|
|
rm -f $@
|
2016-01-30 07:58:37 +08:00
|
|
|
$(AR) -rs $@ $(DEVICE_LIBOBJECTS)
|
2011-09-12 17:21:10 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/libleveldb.a: $(SIMULATOR_LIBOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(SIMULATOR_LIBOBJECTS)
|
2011-09-12 17:21:10 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(DEVICE_OUTDIR)/libmemenv.a: $(DEVICE_MEMENVOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(DEVICE_MEMENVOBJECTS)
|
|
|
|
|
|
|
|
$(SIMULATOR_OUTDIR)/libmemenv.a: $(SIMULATOR_MEMENVOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(SIMULATOR_MEMENVOBJECTS)
|
|
|
|
|
|
|
|
# For iOS, create universal object libraries to be used on both the simulator and
|
2011-05-28 08:53:58 +08:00
|
|
|
# a device.
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/libleveldb.a: $(STATIC_OUTDIR) $(DEVICE_OUTDIR)/libleveldb.a $(SIMULATOR_OUTDIR)/libleveldb.a
|
|
|
|
lipo -create $(DEVICE_OUTDIR)/libleveldb.a $(SIMULATOR_OUTDIR)/libleveldb.a -output $@
|
2011-08-06 04:40:49 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/libmemenv.a: $(STATIC_OUTDIR) $(DEVICE_OUTDIR)/libmemenv.a $(SIMULATOR_OUTDIR)/libmemenv.a
|
|
|
|
lipo -create $(DEVICE_OUTDIR)/libmemenv.a $(SIMULATOR_OUTDIR)/libmemenv.a -output $@
|
2011-05-28 08:53:58 +08:00
|
|
|
else
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/libleveldb.a:$(STATIC_LIBOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(STATIC_LIBOBJECTS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/libmemenv.a:$(STATIC_MEMENVOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(STATIC_MEMENVOBJECTS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(SHARED_MEMENVLIB):$(SHARED_MEMENVOBJECTS)
|
|
|
|
rm -f $@
|
|
|
|
$(AR) -rs $@ $(SHARED_MEMENVOBJECTS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/db_bench:db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_bench.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/db_bench_sqlite3:doc/bench/db_bench_sqlite3.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) doc/bench/db_bench_sqlite3.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ -lsqlite3 $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/db_bench_tree_db:doc/bench/db_bench_tree_db.cc $(STATIC_LIBOBJECTS) $(TESTUTIL)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) doc/bench/db_bench_tree_db.cc $(STATIC_LIBOBJECTS) $(TESTUTIL) -o $@ -lkyotocabinet $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/leveldbutil:db/leveldbutil.cc $(STATIC_LIBOBJECTS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/leveldbutil.cc $(STATIC_LIBOBJECTS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/arena_test:util/arena_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/arena_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/autocompact_test:db/autocompact_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/autocompact_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/bloom_test:util/bloom_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/bloom_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/c_test:$(STATIC_OUTDIR)/db/c_test.o $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/db/c_test.o $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/cache_test:util/cache_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/cache_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/coding_test:util/coding_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/coding_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/corruption_test:db/corruption_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/corruption_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/crc32c_test:util/crc32c_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/crc32c_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/db_test:db/db_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/db_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/dbformat_test:db/dbformat_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/dbformat_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
2017-03-02 04:05:47 +08:00
|
|
|
$(STATIC_OUTDIR)/env_posix_test:util/env_posix_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/env_posix_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/env_test:util/env_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/env_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/fault_injection_test:db/fault_injection_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/fault_injection_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/filename_test:db/filename_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/filename_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/filter_block_test:table/filter_block_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) table/filter_block_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/hash_test:util/hash_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) util/hash_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/issue178_test:issues/issue178_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) issues/issue178_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/issue200_test:issues/issue200_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) issues/issue200_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/log_test:db/log_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/log_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/recovery_test:db/recovery_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/recovery_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/table_test:table/table_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) table/table_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/skiplist_test:db/skiplist_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/skiplist_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/version_edit_test:db/version_edit_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/version_edit_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/version_set_test:db/version_set_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/version_set_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/write_batch_test:db/write_batch_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS)
|
|
|
|
$(CXX) $(LDFLAGS) $(CXXFLAGS) db/write_batch_test.cc $(STATIC_LIBOBJECTS) $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/memenv_test:$(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS)
|
|
|
|
$(XCRUN) $(CXX) $(LDFLAGS) $(STATIC_OUTDIR)/helpers/memenv/memenv_test.o $(STATIC_OUTDIR)/libmemenv.a $(STATIC_OUTDIR)/libleveldb.a $(TESTHARNESS) -o $@ $(LIBS)
|
|
|
|
|
2017-10-05 02:26:45 +08:00
|
|
|
$(SHARED_OUTDIR)/db_bench:$(SHARED_OUTDIR)/db/db_bench.o $(SHARED_LIBS) $(TESTUTIL) $(TEST_STATIC_OBJS)
|
|
|
|
$(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_CXXFLAGS) $(SHARED_OUTDIR)/db/db_bench.o $(TESTUTIL) $(TEST_STATIC_OBJS) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS)
|
2016-01-30 07:58:37 +08:00
|
|
|
|
2017-10-05 02:26:45 +08:00
|
|
|
$(SHARED_OUTDIR)/c_test:$(SHARED_OUTDIR)/db/c_test.o $(SHARED_LIBS) $(TESTUTIL) $(TEST_STATIC_OBJS)
|
|
|
|
$(XCRUN) $(CXX) $(LDFLAGS) $(CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) $(SHARED_CXXFLAGS) $(SHARED_OUTDIR)/db/c_test.o $(TESTUTIL) $(TEST_STATIC_OBJS) $(SHARED_OUTDIR)/$(SHARED_LIB3) -o $@ $(LIBS)
|
|
|
|
|
|
|
|
.PHONY: run-shared-db_bench
|
|
|
|
run-shared-db_bench: $(SHARED_OUTDIR)/db_bench
|
2016-01-30 07:58:37 +08:00
|
|
|
LD_LIBRARY_PATH=$(SHARED_OUTDIR) $(SHARED_OUTDIR)/db_bench
|
|
|
|
|
2017-10-05 02:26:45 +08:00
|
|
|
.PHONY: run-shared-c_test
|
|
|
|
run-shared-c_test: $(SHARED_OUTDIR)/c_test
|
|
|
|
LD_LIBRARY_PATH=$(SHARED_OUTDIR) $(SHARED_OUTDIR)/c_test
|
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(SIMULATOR_OUTDIR)/%.o: %.cc
|
|
|
|
xcrun -sdk iphonesimulator $(CXX) $(CXXFLAGS) $(SIMULATOR_CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(DEVICE_OUTDIR)/%.o: %.cc
|
|
|
|
xcrun -sdk iphoneos $(CXX) $(CXXFLAGS) $(DEVICE_CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(SIMULATOR_OUTDIR)/%.o: %.c
|
|
|
|
xcrun -sdk iphonesimulator $(CC) $(CFLAGS) $(SIMULATOR_CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(DEVICE_OUTDIR)/%.o: %.c
|
|
|
|
xcrun -sdk iphoneos $(CC) $(CFLAGS) $(DEVICE_CFLAGS) -c $< -o $@
|
|
|
|
|
|
|
|
$(STATIC_OUTDIR)/%.o: %.cc
|
2012-03-31 04:15:49 +08:00
|
|
|
$(CXX) $(CXXFLAGS) -c $< -o $@
|
2011-08-06 04:40:49 +08:00
|
|
|
|
2016-01-30 07:58:37 +08:00
|
|
|
$(STATIC_OUTDIR)/%.o: %.c
|
2012-03-31 04:15:49 +08:00
|
|
|
$(CC) $(CFLAGS) -c $< -o $@
|
2016-01-30 07:58:37 +08:00
|
|
|
|
|
|
|
$(SHARED_OUTDIR)/%.o: %.cc
|
2017-10-05 02:26:45 +08:00
|
|
|
$(CXX) $(CXXFLAGS) $(SHARED_BUILD_CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) -c $< -o $@
|
2016-01-30 07:58:37 +08:00
|
|
|
|
|
|
|
$(SHARED_OUTDIR)/%.o: %.c
|
Replace SSE-optimized CRC32C in POSIX port with external library.
Maintaining a hardware-accelerated CRC32C implementation tailored for
all modern platforms deserves a repository of its own. We extracted the
implementation here into https://github.com/google/crc32c and improved
it in that repository. This CL removes the SSE-optimized implementation
from this codebase, and adds the ability to use the google/crc32c
library, if it is present on the system.
The benchmarks below show the performance impact of the change. In
summary, open source builds that use the google/crc32c library can
expect a 3x improvement in CRC32C throughput, whereas builds that do not
use the library will see a 50% drop in CRC32C throughput. This
translates in much smaller changes in overall leveldb performance.
Baseline, MacBookPro13,3 with Core i7 6920HQ:
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 3.064 micros/op; 36.1 MB/s
fillsync : 57.861 micros/op; 1.9 MB/s (1000 ops)
fillrandom : 3.887 micros/op; 28.5 MB/s
overwrite : 4.140 micros/op; 26.7 MB/s
readrandom : 7.433 micros/op; (1000000 of 1000000 found)
readrandom : 6.825 micros/op; (1000000 of 1000000 found)
readseq : 0.244 micros/op; 453.4 MB/s
readreverse : 0.387 micros/op; 285.8 MB/s
compact : 449707.000 micros/op;
readrandom : 4.196 micros/op; (1000000 of 1000000 found)
readseq : 0.228 micros/op; 485.8 MB/s
readreverse : 0.320 micros/op; 345.2 MB/s
fill100K : 562.556 micros/op; 169.6 MB/s (1000 ops)
crc32c : 0.768 micros/op; 5085.0 MB/s (4K per op)
snappycomp : 4.220 micros/op; 925.7 MB/s (output: 55.1%)
snappyuncomp : 0.635 micros/op; 6155.7 MB/s
acquireload : 13.054 micros/op; (each op is 1000 loads)
New with crc32c, MacBookPro13,3 with Core i7 6920HQ:
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 2.820 micros/op; 39.2 MB/s
fillsync : 51.988 micros/op; 2.1 MB/s (1000 ops)
fillrandom : 3.747 micros/op; 29.5 MB/s
overwrite : 4.047 micros/op; 27.3 MB/s
readrandom : 7.287 micros/op; (1000000 of 1000000 found)
readrandom : 6.927 micros/op; (1000000 of 1000000 found)
readseq : 0.253 micros/op; 437.5 MB/s
readreverse : 0.411 micros/op; 269.2 MB/s
compact : 440405.000 micros/op;
readrandom : 4.159 micros/op; (1000000 of 1000000 found)
readseq : 0.230 micros/op; 481.1 MB/s
readreverse : 0.320 micros/op; 345.9 MB/s
fill100K : 558.222 micros/op; 170.9 MB/s (1000 ops)
crc32c : 0.214 micros/op; 18263.5 MB/s (4K per op)
snappycomp : 4.471 micros/op; 873.7 MB/s (output: 55.1%)
snappyuncomp : 0.833 micros/op; 4688.5 MB/s
acquireload : 13.289 micros/op; (each op is 1000 loads)
New without crc32c, MacBookPro13,3 with Core i7 6920HQ
LevelDB: version 1.20
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
RawSize: 110.6 MB (estimated)
FileSize: 62.9 MB (estimated)
------------------------------------------------
fillseq : 3.094 micros/op; 35.8 MB/s
fillsync : 52.160 micros/op; 2.1 MB/s (1000 ops)
fillrandom : 4.090 micros/op; 27.0 MB/s
overwrite : 4.006 micros/op; 27.6 MB/s
readrandom : 6.584 micros/op; (1000000 of 1000000 found)
readrandom : 6.676 micros/op; (1000000 of 1000000 found)
readseq : 0.280 micros/op; 395.2 MB/s
readreverse : 0.391 micros/op; 283.2 MB/s
compact : 433911.000 micros/op;
readrandom : 4.261 micros/op; (1000000 of 1000000 found)
readseq : 0.251 micros/op; 440.5 MB/s
readreverse : 0.356 micros/op; 310.9 MB/s
fill100K : 584.023 micros/op; 163.3 MB/s (1000 ops)
crc32c : 1.384 micros/op; 2822.3 MB/s (4K per op)
snappycomp : 4.763 micros/op; 820.1 MB/s (output: 55.1%)
snappyuncomp : 0.766 micros/op; 5098.6 MB/s
acquireload : 12.931 micros/op; (each op is 1000 loads)
-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=171667771
2017-10-10 21:05:17 +08:00
|
|
|
$(CC) $(CFLAGS) $(SHARED_BUILD_CXXFLAGS) $(PLATFORM_SHARED_CFLAGS) -c $< -o $@
|