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
using System; | |
using System.Runtime.Intrinsics; | |
using System.Runtime.Intrinsics.X86; | |
using System.Runtime.Intrinsics.Arm; | |
using System.Runtime.CompilerServices; | |
using System.Runtime.InteropServices; | |
// Ideally, we would want to implement something that looks like | |
// https://learn.microsoft.com/en-us/dotnet/api/system.text.asciiencoding?view=net-7.0 |
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
52791.000000 164108.000000 353080.000000 | |
43083.000000 134047.000000 342931.000000 | |
42750.000000 132955.000000 342934.000000 | |
42792.000000 133068.000000 342947.000000 | |
42625.000000 132742.000000 342930.000000 | |
42667.000000 132701.000000 342934.000000 | |
42541.000000 132560.000000 342938.000000 | |
42583.000000 132513.000000 342930.000000 | |
42667.000000 132687.000000 342938.000000 | |
42583.000000 132509.000000 342938.000000 |
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 "simdjson.h" | |
#include <iostream> | |
using namespace simdjson; // optional | |
int main() { | |
padded_string json = R"( {"exports": {}} )"_padded; | |
ondemand::parser parser; | |
ondemand::document doc = parser.iterate(json); | |
ondemand::object obj; | |
auto err = doc.get_object().get(obj); |
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
const Benchmark = require('benchmark'); | |
const { TypedFastBitSet } = require('typedfastbitset'); | |
const { RoaringBitmap32 } = require('roaring/RoaringBitmap32'); | |
// Set utils | |
function union(set1, set2) { | |
return new Set([...set1, ...set2]); | |
} | |
function difference(set1, set2) { |
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
/* performance benchmark */ | |
/* This script expects node.js */ | |
"use strict"; | |
const { TypedFastBitSet, SparseTypedFastBitSet } = require("../lib"); | |
const Benchmark = require("benchmark"); | |
const os = require("os"); | |
const smallgap = 3; |
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 <chrono> | |
#include <fstream> | |
#include <iostream> | |
#include <unistd.h> | |
#include <cstring> | |
#include <string_view> | |
#include <memory> | |
#include "ada.h" | |
struct line_iterator { |
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
AVX-512 is a collection of instruction sets. The AVX-512 kernel in simdutf relies on VBMI2, one of the AVX-512 | |
instruction sets. The simdutf library determines at runtime whether the processor supports VBMI2. If not, other (slower) | |
kernels are used, depending on the processor. | |
Not all compilers support the AVX-512 intrinsics that the simdutf library requires. Thus at compile-time, the library | |
checks for Visual Studio 2019 or better, or for the presence of the header 'avx512vbmi2intrin.h'. | |
At compile-time, it is thus assumed that if the compiler has access to 'avx512vbmi2intrin.h', then it can compile | |
the functions that are part of it and produce a VBMI2 code kernel. This should be a safe assumption. |
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 <functional> | |
int g(int x, int y) { | |
auto lambda = [] <typename T>(std::function<T(T,T)> f, T x, T y) { return f(x,y); }; | |
std::function<int(int,int)> f = [](int x, int y)->int {return x + y;}; | |
return lambda(f, x,y); | |
} |
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
/* auto-generated on 2022-10-06 13:43:02 +0000. Do not edit! */ | |
// dofile: invoked with prepath=/home/lemire/CVS/github/simdutf/include, filename=simdutf.h | |
/* begin file include/simdutf.h */ | |
#ifndef SIMDUTF_H | |
#define SIMDUTF_H | |
#include <cstring> | |
// dofile: invoked with prepath=/home/lemire/CVS/github/simdutf/include, filename=simdutf/compiler_check.h | |
/* begin file include/simdutf/compiler_check.h */ | |
#ifndef SIMDUTF_COMPILER_CHECK_H |