On Sexism and Gender Diversity in Tech - NodeJS

Sparked by a recent NodeJS culture conflict

For anyone who works with NodeJS extensively (or any of the popular npm packages), you might be familiar with the “Code of Conduct”s that exist in a lot of npm package repos. The Technical Steering Committee has one and similar ones can be found for Emberjs, Angular, ESLint, Babel, Gulp, Yarn, and so many other repos inside and outside the javascript ecosystem. These guidelines can spark quite a bit of hot debate not only in discussion forums but even in the GitHub issues and merge requests when trying to integrate the ideas and their specifics.

Curiously, there are also quite a few that do not mention anything about “conduct” in their repos, examples being ThreeJS, Bluebird, and Grunt. Perhaps they’ve never considered or had a problematic conduct but there’s also the more worrying possibility that it is a result of apathy of willful resistance (though I would think less likely).

The issue isn’t with those that advocate, the issue is with those that just don’t care. This mentality whereby a person’s conduct is not meaningful if they are productive and commit good code just isn’t good for a healthy community. Poor behavior allowed to persist will only help to exclude those that it targets. The output of the troublemaker in question is not the issue here, but the community that surrounds it.

Though I personally haven’t had to deal with any gender specific barriers in my career (because I’m just a normal guy), it’s not really hard to see how others face issues. From my inquiries into friends’ experiences, to specific internet findings like the so-called “Feminist Software Foundation”, a satirical but also hateful account who would try to characterize very left feminists by making ridiculous pull requests to popular repositories and arguing when they failed, to a general but hushed air of sexism in a few workplaces I’ve worked in, to the recent “manifesto” released by a Google employee, to the online comments mentioned in The Outline’s article, it isn’t hard to see how these issues persist even with awareness and advocacy. The issue isn’t that non-males output is unfairly decided to be worse; a narrow view of the issue. There issue is instead systematic and based in society. A few bad actors (intentional or otherwise) and many mostly-indifferent bystanders keep certain groups from entering tech whether at interviews, in academics, in childhood development, or other aspects of life/social development. It’s not always explicit yet it’s just behind every door.

Powered by Hexo Logo Fursona by TFOTR

Automated Memory Leak Testing in the Browser

Large single page web applications have a disadvantage over multi-page applications in that no page reload occurs. This means memory leaks are able to cause more performance problems in single page web applications as the lack of page reloads will not clear the javascript heap. While catching these leaks can be done by manually memory profiling, I will show you an automated test that will give a glimpse at whether memory leaks may be occuring.

The actual test is pretty simple though it requires Chrome to run. This is because Chrome comes with some nifty flags that let in browser tests do things other browsers can’t.

  1. Chrome is the only browser that has the ability to read precise memory usage via javascript. This is enabled by the --enable-precise-memory-info flag.
  2. Chrome also is the only browser that allows you to trigger the garbage collector from javascript. This is enabled by the custom javascript flag --js-flags="--expose-gc"

Where I currently work, we use the Karma test runner for testing so setting up different browsers is as easy as installing an npm module and adding the browser to the build with the given flags.

After adding Chrome to your test runner, you will want to add the actual memory test. The memory test consists of a few parts.