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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>me.olshansky</groupId> | |
<artifactId>elastik</artifactId> | |
<version>1.0-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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
package me.olshansky | |
import com.fasterxml.jackson.core.JsonFactory | |
import com.fasterxml.jackson.databind.DeserializationFeature | |
import com.fasterxml.jackson.databind.ObjectMapper | |
import com.fasterxml.jackson.dataformat.smile.SmileFactory | |
import com.fasterxml.jackson.module.kotlin.KotlinModule | |
import org.http4k.client.ApacheClient | |
import org.http4k.core.* | |
import org.http4k.core.Method.* |
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
#!/bin/sh | |
# enable automatic i386/ARM/M68K/MIPS/SPARC/PPC/s390/HPPA/Xtensa/microblaze | |
# program execution by the kernel | |
qemu_target_list="i386 i486 alpha arm armeb sparc32plus ppc ppc64 ppc64le m68k \ | |
mips mipsel mipsn32 mipsn32el mips64 mips64el \ | |
sh4 sh4eb s390x aarch64 aarch64_be hppa riscv32 riscv64 xtensa xtensaeb microblaze microblazeel" | |
i386_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x03\x00' | |
i386_mask='\xff\xff\xff\xff\xff\xfe\xfe\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff' |
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
import std.stdio; | |
// works for x86_64 ;) | |
R enterThreadedCode(R, T)(R function(T) target, T arg) { | |
asm @nogc nothrow { | |
naked; | |
mov RAX, RSP; | |
mov RSP, [RDI]; | |
push RAX; | |
mov RAX, [RDI]; |
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
// Consider that we spin up one of these guys per file | |
// the idea is that we can interrupt this fiber by sending Control message | |
// that will be processed out of bounds | |
void logFileProcessor(Stream!Control controlPlane, File inp) | |
{ | |
bool done = false; | |
auto source = inp.byLine; // | |
while(!done){ | |
multiplex( // pick one of sources that are ready and execute branches | |
controlPlane, { |
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
Library topics | |
1. Multi-threading the scheduler. | |
- have a thread pool with thread per core (+affinity to avoid overheads) | |
- balance each spawned fiber to e.g. least-loaded thread of the pool | |
- provide a hint to spawn on the same thread as parent (?) |
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
{| class="wikitable" | |
! Module | |
! Artifact | |
! Reason | |
! Possible Fix(es) | |
|- | |
|- | |
|std.algorithm [https://github.com/D-Programming-Language/phobos/blob/95222b884d7ad1a75b336f8f64a5a3bb2303ed1f/std/algorithm.d#L10409] | |
|TimSortImpl.sort |
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
Seems good. Numbers themselves have variability of up to 2 Mb/s between runs of exactly the same test. | |
Before (git HEAD): | |
==================== | |
m8-Alpha [arwiki], 273256 hits, 5.67256, 110.15 Mb/s | |
m8-Mark [arwiki], 496 hits, 5.8008, 107.71 Mb/s | |
m8-Symbol [arwiki], 152 hits, 5.80076, 107.71 Mb/s | |
m8-Number [arwiki], 7216 hits, 5.78192, 108.06 Mb/s | |
tri-alpha [arwiki], 273256 hits, 8.79468, 71.04 Mb/s | |
decode-only [arwiki], 342832 hits, 2.50764, 249.16 Mb/s |
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
module trusted; | |
/// Forward arguments to some @system callable $(D fun) | |
auto ref call(alias fun, Args...)(auto ref Args args) @trusted | |
{ | |
return fun(args); | |
} | |
/// @trusted function to clearly isolate taking address of a local | |
auto addrOf(T)(ref T value) @trusted |
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
/// $(D write)-style construction of exceptions, optionally with given super type. | |
auto exception(Base=Exception, string file = __FILE__, | |
size_t line = __LINE__, Args...)(Args args) | |
{ | |
return exceptionfImpl!Base(null, args, file, line); | |
} | |
/// $(D writef)-style construction of exceptions, optionally with given super type. | |
auto exceptionf(Base=Exception, string file = __FILE__, | |
size_t line = __LINE__, Args...)(string fmt, Args args) |
NewerOlder