Skip to content

Instantly share code, notes, and snippets.

@scriby
scriby / protractor-sync_test.ts
Created July 14, 2017 19:10
Protractor memory leak test
import * as ab from 'asyncblock';
import * as fs from 'fs';
import { by } from 'protractor';
import * as profiler from 'v8-profiler';
import { browserSync, elementSync } from '../../app/vars';
new Array(5000).join().split(',').forEach((num, i) => {
describe('1', () => {
beforeAll(() => {
@scriby
scriby / Connection
Last active December 11, 2015 18:08
Experiment to increase serialization speed of mongodb nodejs driver
// Write the data out to the socket
Connection.prototype.write = function(command, callback) {
try {
// If we have a list off commands to be executed on the same socket
if(Array.isArray(command)) {
for(var i = 0; i < command.length; i++) {
var binaryCommand = command[i].toBinary()
if(!this.socketOptions['disableDriverBSONSizeCheck'] && binaryCommand.length > this.maxBsonSize)
return callback(new Error("Document exceeds maximal allowed bson size of " + this.maxBsonSize + " bytes"));
if(this.logger != null && this.logger.doDebug)