Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
152c8301
Unverified
Commit
152c8301
authored
Dec 21, 2018
by
Yilun Chong
Committed by
GitHub
Dec 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix python benchmark throughput; Change back to not using docker for benchmar (#5503)
parent
1354e469
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
11 deletions
+29
-11
Makefile.am
benchmarks/Makefile.am
+3
-3
PhpBenchmark.php
benchmarks/php/PhpBenchmark.php
+1
-0
py_benchmark.py
benchmarks/python/py_benchmark.py
+1
-1
build.sh
kokoro/linux/benchmark/build.sh
+22
-5
tests.sh
tests.sh
+2
-2
No files found.
benchmarks/Makefile.am
View file @
152c8301
...
...
@@ -521,10 +521,10 @@ php-benchmark: proto3_middleman_php generate_proto3_data
@
chmod
+x php-benchmark
php
:
php-benchmark proto3_middleman_php
./php-benchmark
$(proto3_data)
./php-benchmark
--behavior_prefix
=
"php"
$(proto3_data)
php_c_extension
:
cd
$(top_srcdir)
/php/ext/google/protobuf
&&
./configure
CFLAGS
=
'-O3'
&&
make
-j8
cd
$(top_srcdir)
/php/ext/google/protobuf
&&
phpize
&&
./configure
CFLAGS
=
'-O3'
&&
make
-j8
php-c-benchmark
:
proto3_middleman_php generate_proto3_data php_c_extension php_c_extension
mkdir
-p
"tmp/php/Google/Protobuf/Benchmark"
&&
cp
php/PhpBenchmark.php
"tmp/php/Google/Protobuf/Benchmark"
...
...
@@ -540,7 +540,7 @@ php-c-benchmark: proto3_middleman_php generate_proto3_data php_c_extension php_c
@
chmod
+x php-c-benchmark
php_c
:
php-c-benchmark proto3_middleman_php
./php-c-benchmark
$(proto3_data)
./php-c-benchmark
--behavior_prefix
=
"php_c"
$(proto3_data)
############ PHP RULES END #################
...
...
benchmarks/php/PhpBenchmark.php
View file @
152c8301
<?php
namespace
Google\Protobuf\Benchmark
;
ini_set
(
'memory_limit'
,
'4096M'
);
const
NAME
=
"PhpBenchmark.php"
;
...
...
benchmarks/python/py_benchmark.py
View file @
152c8301
...
...
@@ -138,7 +138,7 @@ class Benchmark:
t
=
timeit
.
timeit
(
stmt
=
"
%
s(
%
s)"
%
(
self
.
test_method
,
test_method_args
),
setup
=
self
.
full_setup_code
(
setup_method_args
),
number
=
reps
);
return
self
.
total_bytes
*
1.0
/
2
**
20
/
(
1.0
*
t
/
reps
)
return
self
.
total_bytes
*
1.0
/
2
**
20
/
(
1.0
*
t
/
reps
*
self
.
full_iteration
)
if
__name__
==
"__main__"
:
...
...
kokoro/linux/benchmark/build.sh
View file @
152c8301
...
...
@@ -2,8 +2,25 @@
cd
$(
dirname
$0
)
/../../..
export
DOCKERFILE_DIR
=
kokoro/linux/64-bit
export
DOCKER_RUN_SCRIPT
=
kokoro/linux/pull_request_in_docker.sh
export
OUTPUT_DIR
=
testoutput
export
TEST_SET
=
"benchmark"
./kokoro/linux/build_and_run_docker.sh
# prepare php environments
sudo
apt-get update
&&
sudo
apt-get
install
-y
--force-yes
php5
sudo ln
-sf
/usr/include/x86_64-linux-gnu/gmp.h /usr/include/gmp.h
mkdir
php_temp
cd
php_temp
curl
-sS
https://getcomposer.org/installer | php
sudo mv
composer.phar /usr/local/bin/composer
git clone https://github.com/php/php-src
cd
php-src
&&
git checkout PHP-7.2.13
&&
./buildconf
--force
./configure
\
--enable-bcmatch
\
--with-gmp
--with-openssl
\
--with-zlib
\
--prefix
=
/usr/local/php-7.2
&&
\
make
-j8
&&
sudo
make
install
&&
make clean
wget
-O
phpunit https://phar.phpunit.de/phpunit-7.phar
&&
\
chmod
+x phpunit
&&
\
sudo cp
phpunit /usr/local/php-7.2/bin
sudo
apt-get
install
-y
--force-yes
valgrind
cd
../..
./tests.sh benchmark
tests.sh
View file @
152c8301
...
...
@@ -591,7 +591,7 @@ build_php_all() {
}
build_benchmark
()
{
use_php 7.
1
use_php 7.
2
cd
kokoro/linux/benchmark
&&
./run.sh
}
...
...
@@ -628,7 +628,7 @@ Usage: $0 { cpp |
php7.1 |
php7.1_c |
php_all |
benchmark)
benchmark)
"
exit
1
fi
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment