Skip to content

Instantly share code, notes, and snippets.

View ovr's full-sized avatar
🦀

Dmitry Patsura ovr

🦀
View GitHub Profile
@ovr
ovr / main.rs
Created April 13, 2026 16:04
Memory benchmark: OLD vs NEW InfoSchemaTableDef approach in cubestore (system_cache table)
// Bench for system_cache: 10k rows, cache values varying in size.
// User scenario: total cache 52MB–256MB → avg value size 5KB–26KB per row for 10k rows.
//
// Key differences vs info_schema_columns:
// 1. OLD clones Option<String> via `get_prefix().clone()` → extra allocation per row.
// 2. `value` is large (~KBs), so the "incremental drop of source during into_iter" matters:
// OLD keeps full source alive across 4 passes; NEW drops each row after appending.
use std::alloc::{GlobalAlloc, Layout, System};
use std::sync::atomic::{AtomicUsize, Ordering};
import java.sql.*;
import java.util.Properties;
public class Discover {
public static void main(String[] args) throws Exception {
Properties props = new Properties();
props.setProperty("user", "ovr");
props.setProperty("password", "test");
try (Connection conn = DriverManager.getConnection("jdbc:postgresql://localhost:5555/db", props)) {
// List public tables
@ovr
ovr / verify_lanczos3.py
Last active March 6, 2026 16:41
Verify burn's lanczos3 interpolation test_upsample_2x expected values (comparison with TF, JAX, PIL)
"""
Verify burn's lanczos3 interpolation against TensorFlow, JAX, and PIL.
Test case: 4x4 -> 8x8 upsample with half-pixel coordinate mapping
(align_corners=false), which is the default for TF/JAX/PIL.
Input: arange(16).reshape(4,4)
Setup:
python3 -m venv venv
@ovr
ovr / Переизобретая Асинхроность ссылочки
Last active March 15, 2020 20:00
Переизобретая Асинхроность ссылочки
Обо мне
Twitter - https://twitter.com/ovrweb
UnderJS Podcast https://underjs.ru/
Доклад - https://www.icloud.com/keynote/0gKSWDvy_lmWLQDUUJjt5wqwA#async
Ссылки по докладу
- Библиотека - https://github.com/ovr/async-std
- Кольцо-защиты https://ru.wikipedia.org/wiki/%D0%9A%D0%BE%D0%BB%D1%8C%D1%86%D0%B0_%D0%B7%D0%B0%D1%89%D0%B8%D1%82%D1%8B
<?php
$client = new SimpleClient(
new HttpStack(
new \Zend\Diactoros\RequestFactory(),
new \Zend\Diactoros\StreamFactory()
)
);
$request = $client->createRequest('GET', 'https://api.github.com/users/ovr');
<?php
class RequestBuilder
{
/**
* @var HttpStack
*/
private $httpStack;
/**
@ovr
ovr / http-stack.php
Created July 14, 2019 10:52
Combining RequestFactoryInterface, StreamFactoryInterface from PSR-17
<?php
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Psr\Http\Message\StreamInterface;
class HttpStack implements RequestFactoryInterface, StreamFactoryInterface
{
/**
@ovr
ovr / client.php
Last active July 14, 2019 09:11
PSR-18 HTTP-client with PSR-17 ResponseFactoryInterface for Response
<?php
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
class Client implements ClientInterface {
/**
* @var ResponseFactoryInterface
@ovr
ovr / gist:7bba0c7a079b7bbc320c5b01c39140b5
Created January 16, 2019 23:01 — forked from jestan/gist:4411538
MAP Protocol Error Codes

MAP Protocol Error Codes

Generic errors

34 System failure

35 Data Missing

36 Unexpected Data Value

21 Facility Not Supported

@ovr
ovr / links.md
Last active September 14, 2021 11:39