Files
sdk/benchmarks/FfiCall/dart/native/Makefile
T
Daco Harkes fbf13f561f [benchmarks/ffi] Add micro and macro benchmarks for dart:ffi
Adds micro benchmarks to measure low level (1) C memory reads and writes from Dart and (2) calls from Dart into C. This CL also adds a macro benchmark to measure overall performance using BoringSSL to digest data. The shared libraries are precompiled for Linux and live in cipd packages. The benchmarks run on all hardware architectures (with the exception of Linux'es hardfp on Arm32: https://github.com/dart-lang/sdk/issues/36309).

Issue: https://github.com/dart-lang/sdk/issues/36247

Change-Id: I8dfb30cc66a26a2942bb09194c5eb0da0b6ca1b5
Cq-Include-Trybots: luci.dart.try:benchmark-linux-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108724
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Jonas Termansen <sortie@google.com>
Auto-Submit: Daco Harkes <dacoharkes@google.com>
2019-07-19 14:59:57 +00:00

61 lines
2.0 KiB
Makefile

# Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
# for details. All rights reserved. Use of this source code is governed by a
# BSD-style license that can be found in the LICENSE file.
# TODO(37531): Remove this makefile and build with sdk instead when
# benchmark runner gets support for that.
CC=gcc
CCARM=arm-linux-gnueabihf-gcc
CCARM64=aarch64-linux-gnu-gcc
CFLAGS=-Wall -g -O -fPIC
# Bump this whenever the benchmark is updated.
VERSION=1
.PHONY: all clean
all: out/linux/x64/libnative_functions.so out/linux/ia32/libnative_functions.so out/linux/arm64/libnative_functions.so out/linux/arm/libnative_functions.so
cipd:
cipd create -name dart/benchmarks/fficall -in out -install-mode copy -tag version:$(VERSION)
clean:
rm -rf *.o *.so out
out/linux/x64:
mkdir -p out/linux/x64
out/linux/x64/native_functions.o: native_functions.c | out/linux/x64
$(CC) $(CFLAGS) -c -o $@ native_functions.c
out/linux/x64/libnative_functions.so: out/linux/x64/native_functions.o
$(CC) $(CFLAGS) -s -shared -o $@ out/linux/x64/native_functions.o
out/linux/ia32:
mkdir -p out/linux/ia32
out/linux/ia32/native_functions.o: native_functions.c | out/linux/ia32
$(CC) $(CFLAGS) -m32 -c -o $@ native_functions.c
out/linux/ia32/libnative_functions.so: out/linux/ia32/native_functions.o
$(CC) $(CFLAGS) -m32 -s -shared -o $@ out/linux/ia32/native_functions.o
out/linux/arm64:
mkdir -p out/linux/arm64
out/linux/arm64/native_functions.o: native_functions.c | out/linux/arm64
$(CCARM64) $(CFLAGS) -c -o $@ native_functions.c
out/linux/arm64/libnative_functions.so: out/linux/arm64/native_functions.o
$(CCARM64) $(CFLAGS) -s -shared -o $@ out/linux/arm64/native_functions.o
out/linux/arm:
mkdir -p out/linux/arm
out/linux/arm/native_functions.o: native_functions.c | out/linux/arm
$(CCARM) $(CFLAGS) -c -o $@ native_functions.c
out/linux/arm/libnative_functions.so: out/linux/arm/native_functions.o
$(CCARM) $(CFLAGS) -s -shared -o $@ out/linux/arm/native_functions.o