Skip to content

Instantly share code, notes, and snippets.

View mtanski's full-sized avatar

Milosz Tanski mtanski

View GitHub Profile
@mtanski
mtanski / pprof.md
Created May 2, 2025 17:27 — forked from slok/pprof.md
Go pprof cheat sheet

Enable profiling

Default http server

import (
    _ "net/http/pprof"
    "net/http"
)
struct Cols {
int count; // # of cols
void **col_ptr; // Pointer to an array of column data (arrays)
uint8_t **nulls_ptr; // Pointer to an array of null values
}
bool groupby_rows_equal(size_t row_id, Cols* rhs, Cols* rhs) {
void *rhs_col, *lhs_col;
uint8_t rhs_null, rhs_null;
use std::marker::PhantomData;
use std::fmt::Display;
use ::allocator::Allocator;
use ::block::{Block, View, RefColumn, column_rows, column_nulls};
use ::error::DBError;
use ::expression::*;
use ::row::RowOffset;
use ::schema::{Attribute, Schema};
use ::types::*;
use std::marker::PhantomData;
use std::fmt::Display;
use ::allocator::Allocator;
use ::block::{Block, View, RefColumn, column_rows, column_nulls};
use ::error::DBError;
use ::expression::*;
use ::row::RowOffset;
use ::schema::{Attribute, Schema};
use ::types::*;
use std::marker::PhantomData;
use std::fmt::Display;
use ::allocator::Allocator;
use ::block::{Block, View, RefColumn, column_rows, column_nulls};
use ::error::DBError;
use ::expression::*;
use ::row::RowOffset;
use ::schema::{Attribute, Schema};
use ::types::*;
[error] (the most common reason for that is that you cannot use macro implementations in the same compilation run that defines them)
[error] .map(MapMacro.makeMapper[LogSchemaV6])
[error] ^
[error] one error found
[error] (job/compile:compileIncremental) Compilation failed
[error] Total time: 9 s, completed Oct 7, 2016 11:18:57 AM
Job.scala:
inputFiles(conf.input)
mtanski@buildbox:~/world/mr_jobs$ cat build.sbt
import Dependencies._
name := "mr_jobs"
scalaVersion in ThisBuild := "2.11.8"
scalacOptions += "-Ymacro-debug-lite -Yrangepos"
lazy val commonSettings = Seq(
organization := "com.adfin",
version := "0.5.0"
void bools_and(unsigned count, const u8 *rhs, const u8 *lhs, u8 *out) {
for (unsigned off = 0; off < count; off++) {
out[off] = rhs[off] & lhs[off];
}
}
#[cfg(test)]
mod tests {
use super::*;
use ::allocator;
use ::schema::{Attribute, Schema};
use ::operation::{Cursor, Operation, ScanView};
use ::projector::*;
use ::table::{Table, TableAppender};
use ::types::*;
@mtanski
mtanski / gist:1ff9a5569557e13f7b0e
Created July 2, 2015 20:50
SIMD (kind of) mod2 float32
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <emmintrin.h>
#include <pmmintrin.h>
uint32_t shifts[] = {
1 << 23, 1 << 22, 1 << 21, 1 << 20,
1 << 19, 1 << 18, 1 << 17, 1 << 16,