Skip to content

Instantly share code, notes, and snippets.

View rob-p's full-sized avatar
🎯
Focusing

Rob Patro rob-p

🎯
Focusing
View GitHub Profile
@rob-p
rob-p / test_decomp.sh
Created October 26, 2024 14:44
parallel decompression speed test
#!/bin/bash
#
# This is a rather minimal example Argbash potential
# Example taken from http://argbash.readthedocs.io/en/stable/example.html
#
# ARG_OPTIONAL_BOOLEAN([delete-tmp],[],[delete output directory])
# ARG_POSITIONAL_SINGLE([num-threads],[number of threads to run with],[])
# ARG_POSITIONAL_SINGLE([input],[input file list],[])
# ARG_HELP([Test how long it takes to decompress many files in parallel])
# ARGBASH_GO()
@rob-p
rob-p / record_search.rs
Created January 4, 2025 03:03
use memchr
fn create_record(line: &str) -> Record {
let finder = memchr::memmem::Finder::new("bc");
let mut iter = line.split('\t').peekable();
let name = iter.peek().unwrap().to_string();
let count = iter
.filter(|s| finder.find(s[1..4].as_bytes()).is_some())
.count();
Record::new(name, count)
}
#ifndef STREAMING_QUERY_HPP
#define STREAMING_QUERY_HPP
#include "../external/pthash/external/essentials/include/essentials.hpp"
#include "../include/dictionary.hpp"
#include "../include/query/streaming_query_canonical_parsing.hpp"
#include "../include/util.hpp"
#include <sstream>
namespace piscem {