function f1(t)
local t1 = util.get_ticks(true);
for i=1,1000500 do table.insert(t, i) end
local t2 = util.get_ticks(true)
print(string.format("%d = %d", #t, t2 - t1))
end
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
local u = require "lua_util" | |
local m = require "lua_magic" | |
local l = require "rspamd_logger" | |
local text = require "rspamd_text" | |
local rspamd_task = require "rspamd_task" | |
local rspamd_util = require "rspamd_util" | |
local function load_task(opts, fname) | |
if not fname then | |
fname = '-' |
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
local cr = require "rspamd_cryptobox_hash" | |
local rspamd_util = require "rspamd_util" | |
local lua_util = require "lua_util" | |
repeat | |
local inp = rspamd_util.readline() | |
if inp then | |
print(cr.create(lua_util.rspamd_str_trim(inp)):base32():sub(1, 32)) | |
end | |
until not inp |
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
local fun = require "fun" | |
local rspamd_util = require "rspamd_util" | |
local l = require "rspamd_logger" | |
-- filter(map(ls)) | |
local function t(inp, f) | |
return fun.filter(function(map_elt) return map_elt end, | |
fun.map(function(list_elt) | |
return f(list_elt) | |
end, inp)) |
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
https://docs.google.com/document/d/1C0PFKevjK48ozW0dtF5K6a9pbS0ATcplNxqjvbbcWxY/edit?usp=sharing |
I hereby claim:
- I am vstakhov on github.
- I am vstakhov (https://keybase.io/vstakhov) on keybase.
- I have a public key whose fingerprint is DD9A 126C E675 1EA5 2A97 04A3 0764 7B67 9008 1437
To claim this, I am signing this object:
- Get source package:
apt-get source libjemalloc-dev
- Install build depends:
apt-get build-dep libjemalloc-dev
- Go to the source dir and edit
debian/rules
file adding the following text:
override_dh_auto_configure:
dh_auto_configure -- --enable-debug --enable-fill --enable-prof --enable-stat
- Build packages:
dpkg-buildpackage
- If we have any complicated (multipart or message) part in the top, then apply the following algorithm. Otherwise goto step 10
- Use multipattern scan (hyperscan/aho-corasic) to find all occurences of patterns
\r--
and\n--
- For each occurence we check sanity:
- We find the length of substring where there are no
\r
and\n
- We check the ending of this substring
- If this substring is empty, we skip it
- If this substring ends with
--
we assume it closing
- For normal boundaries calculate
H(boundary)
, whereH
is a hash function described below
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 <stdint.h> | |
#include <string.h> | |
#include <assert.h> | |
static inline uint64_t | |
diffuse(uint64_t val) | |
{ | |
uint64_t a, b; | |
val *= 0x6eed0e9da4d94a4fULL; | |
//a = val >> 32; |
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 <stdint.h> | |
#include <string.h> | |
#include <assert.h> | |
static inline uint64_t | |
diffuse(uint64_t val) | |
{ | |
uint64_t a, b; | |
val *= 0x6eed0e9da4d94a4fULL; | |
a = val >> 32; |
NewerOlder