This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
se uni::perl; | |
use Benchmark ':all'; | |
use lib::abs; | |
BEGIN {unshift @INC, lib::abs::path 'kraih/lib' } | |
use Mojo::ByteStream 'b';; | |
say $INC{'Mojo/ByteStream.pm'}; | |
my %results; | |
$results{old} = timethis -1 , sub { b('x'x1000) }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use uni::perl; | |
use Benchmark ':all'; | |
use lib::abs; | |
BEGIN {unshift @INC, lib::abs::path 'kraih/lib' } | |
use Mojo::ByteStream 'b';; | |
say $INC{'Mojo/ByteStream.pm'}; | |
my %results; | |
$results{old1} = timethis -1 , sub { b("тестовая строка")->encode('utf8')->decode('utf8') }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use uni::perl; | |
use lib::abs '../../lib'; | |
use AnyEvent::Impl::Perl; # Better to use Impl::Perl for tests | |
use AE; | |
use AnyEvent::HTTP::Server; | |
AnyEvent::HTTP::Server->new( | |
host => '89.208.136.108', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Compile me: | |
$ gcc -Wall -o strlen-bench strlen-bench.c -lrt -g -ggdb -O3 | |
*/ | |
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/time.h> | |
#include <sys/types.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include <sys/time.h> | |
#include <sys/types.h> | |
#include "picohttpparser.h" | |
#include "httpfast.h" | |
#include <unistd.h> | |
#include <time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN { | |
require Config; | |
if (tied %Config::Config) { eval { | |
for (keys %Config::Config) { | |
local *Config::STORE = sub { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (sizeof(uintmax_t) == 8) { | |
size_t i; | |
uintmax_t | |
*l = (uintmax_t *) str->str, | |
xx = 0x2020202020202020ULL; | |
; | |
for (i=0; i < str->len / 8; i++) { | |
xx ^= l[i]; | |
} | |
unsigned char x = |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Usage: | |
#include "benchmark.h" | |
int test1 (va_list ap) { | |
char *str1 = va_arg( ap, char * ); | |
char *str2 = va_arg( ap, char * ); | |
... | |
return ...; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Compile me: | |
gcc -o asmbench asmbench.c -L. -laelf64 -lrt -O0 && ./asmbench | |
Asmlib is here: http://agner.org/optimize/#asmlib | |
*/ | |
#include "benchmark.h" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Usage: | |
my $x = XSTesting::makecb("my arg"); | |
say $x->(); | |
*/ | |
#include "EXTERN.h" | |
#include "perl.h" |
OlderNewer