harningt/luajson — Issue #16: Fix performance loss
Author: harningt
Created: 2011-10-11 03:55:01+00:00
State: open

Performance has significantly dropped with the recursion limitation bandaid. Running performance tests on old releases yield similar performance up until 1.2.1. 1.2.2, with its Cmt recursion fix takes 10x as long parsing some test data. It also takes up significantly more memory.

Test data given current branches/tags:

## 1.0.3
Memory consumed during parsing: 1313.6 kb
Memory consumed by parsed data: 222.4 kb
Took 5.09 s to decode 184.54 kb 100 times - 19.65 / s
Parsed 3.54 mb / s

## 1.1.2
Memory consumed during parsing: 1310.8 kb
Memory consumed by parsed data: 219.6 kb
Took 5.03 s to decode 184.54 kb 100 times - 19.87 / s
Parsed 3.58 mb / s

## 1.2.1
Memory consumed during parsing: 1310.8 kb
Memory consumed by parsed data: 219.6 kb
Took 5.16 s to decode 184.54 kb 100 times - 19.39 / s
Parsed 3.49 mb / s

## 1.2.2 - with recursion patch
Memory consumed during parsing: 57479.1 kb
Memory consumed by parsed data: 219.8 kb
Took 48.95 s to decode 184.54 kb 100 times - 2.04 / s
Parsed 0.37 mb / s

## nonrecursive branch
Memory consumed during parsing: 1407.6 kb
Memory consumed by parsed data: 219.6 kb
Took 8.17 s to decode 184.54 kb 100 times - 12.24 / s
Parsed 2.21 mb / s