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
public class Example2 { | |
static class NotFoundException extends Exception {} | |
static class Database { | |
java.util.Map<String,Integer> entries; | |
Database() { | |
entries = java.util.Collections.synchronizedMap(new java.util.HashMap<String,Integer>()); | |
} |
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
#!/usr/bin/env python3 | |
"""Illustrates (de)compression of multiple lz4framed files/streams""" | |
from time import monotonic | |
from sys import argv | |
from os import cpu_count | |
from io import BytesIO, SEEK_END | |
from concurrent.futures import ThreadPoolExecutor |
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
#!/usr/bin/env python3 | |
"""Illustrates (de)compression of multiple lz4framed files/streams without overhead of using the data.""" | |
from time import monotonic | |
from sys import argv | |
from os import cpu_count | |
from concurrent.futures import ThreadPoolExecutor | |
from lz4framed import Decompressor, Compressor, Lz4FramedNoDataError |
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
#!/usr/bin/env python3 | |
""" | |
Schema used: | |
SET sql_mode = 'NO_ENGINE_SUBSTITUTION,ANSI,MAXDB,TRADITIONAL,NO_AUTO_VALUE_ON_ZERO,ONLY_FULL_GROUP_BY'; | |
CREATE DATABASE "leak_test"; | |
USE "leak_test" |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
# Copyright (c) 2017 Iotic Labs Ltd. All rights reserved. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# https://github.com/Iotic-Labs/py-lz4framed/blob/master/LICENSE |
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
#!/usr/bin/env python3 | |
from time import monotonic | |
from lz4framed import compress | |
SHORT_INPUT = b'abcdefghijklmnopqrstuvwxyz0123456789' | |
LONG_INPUT = SHORT_INPUT * (10**5) | |
# Input a byte shorter than below does not trigger slowdown (for new lz4, not r131) | |
# LONG_INPUT = LONG_INPUT[:65550] |
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 <stdlib.h> | |
#include <stdio.h> | |
#include <string.h> | |
#include "lz4frame_static.h" | |
/******************************************************************************/ | |
static LZ4F_preferences_t prefs_defaults = {{0, 0, 0, 0, 0, {0}}, 0, 0, {0}}; |