Skip to content

Instantly share code, notes, and snippets.

======================================================================
ERROR: test_ipdb.TestImplicit.test_snapshots
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/blackwithwhite/Work/pyroute2/venv/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/blackwithwhite/Work/pyroute2/tests/general/test_ipdb.py", line 1456, in test_snapshots
y.revert(s).commit()
File "/home/blackwithwhite/Work/pyroute2/tests/pyroute2/ipdb/interfaces.py", line 965, in commit
raise error
Let's test memory consumption on server with ~10k NDP entries.
$ time ip neigh | wc -l
11830
Code simply invoke `IPRoute.get_neighbours` method. Memory consumption was recorded with valgrind and massif.
```
from pyroute2 import IPRoute
IPRoute().get_neighbours(socket.AF_INET6)
@blackwithwhite666
blackwithwhite666 / .gitignore
Last active January 4, 2016 15:09
external and parallel merge sort
.DS_Store
*.pyc
*$py.class
*~
.*.sw[po]
dist/
*.egg-info
*.egg
*.egg/
doc/__build/*
@blackwithwhite666
blackwithwhite666 / thread_local.diff
Created December 23, 2013 08:16
Usage of thread-local static variable for slab in pyuv
diff --git a/setup.py b/setup.py
index 67ddc8f..4a957e0 100644
--- a/setup.py
+++ b/setup.py
@@ -37,6 +37,7 @@ setup(name = "pyuv",
'sdist' : libuv_sdist},
ext_modules = [Extension('pyuv',
sources = ['src/pyuv.c'],
+ extra_compile_args=['-std=c99'],
define_macros=[('MODULE_VERSION', __version__),
from __future__ import absolute_import
import time
import bisect
import select
from threading import Thread
from pyasn1.codec.ber import encoder, decoder
from pysnmp.proto import api
from pysnmp.carrier.asynsock.dispatch import AsynsockDispatcher
@blackwithwhite666
blackwithwhite666 / connection.pyx
Created May 30, 2012 06:31
Cython - gevent - thrift server. Prototype.
# cython: profile=True
from gevent import socket
import logging
import struct
from libcpp.string cimport string
cimport cython
from cpython cimport bool
from gevent.hub import get_hub
from gevent.event import Event
@blackwithwhite666
blackwithwhite666 / .gitignore
Created April 4, 2012 06:30
Solve Diophantine equation with Haskell
dist
cabal-dev
*.o
*.hi
*.chi
*.chs.h
.virthualenv
.hsenv
.cabal-sandbox/
cabal.sandbox.config
@blackwithwhite666
blackwithwhite666 / amqp.py
Created April 4, 2012 06:27
Base primitives for txAMQP
from abc import ABCMeta, abstractmethod
from google.protobuf.message import Message
from twisted.application.internet import _AbstractClient, _maybeGlobalReactor
from twisted.internet import protocol
from twisted.internet.defer import inlineCallbacks, Deferred, returnValue, \
maybeDeferred, DeferredLock
from twisted.python import log
from txamqp.client import Closed as ClientClosed, TwistedDelegate
from txamqp.content import Content
from txamqp.protocol import AMQClient