JAXB unmarshalling ? Sax reader ? What about… nothing.

Here is a very tiny and naive xml parser made in kotlin. One function, one input (string), one output (map). Simple, and lightweight (no library). /]+)[^>]*>") val OPENING_CLOSING_TAG = Regex("^< ([^ >/]+)[^>]*/>") val CLOSING_TAG = Regex("^]+)>") val ATTRS = Regex("([a-zA-Z][a-zA-Z-0-9]*)=\"([^\"]*)\"") val root = mutableMapOf() val deque = ArrayDeque(listOf(root)) val attrSetFunc = {text: String, node: MutableMap… Read More »

Benchmarkjs : a very small tool to compare speed

Wanting to quickly figure out which way is the fastest ? Want to see median times in µs ? Download that module : https://gist.github.com/libetl/952e026f889be1cc7cdb3b42767ea845 And call benchmark that way : (copy/paste that code, change 'forThisWork' - what to measure, 'theContestants '- who to measure, and 'seedInit' - what data should it use) benchmark({theContestants: {naive: seed… Read More »