kikito / middleclass

Object-orientation for Lua
https://github.com/kikito/middleclass
MIT License
1.77k stars 190 forks source link

Add pretty-printing to the performance test suite. #66

Open ActivexDiamond opened 1 year ago

ActivexDiamond commented 1 year ago

Changed the printing of performance/* to display a pretty ASCII-style table. Should work anywhere with a monospace font selected. See results below.

Before:

class creation  0.040225
instance creation       0.004141
instance method invocation      0.000528
inherited method invocation     0.000512
class method invocation 0.000554
inherited class method invocation       0.001227

After:

|---------------------------------------------------|
|              process              |       ms      |
|---------------------------------------------------|
| class creation                    |  40.701000000 |
| instance creation                 |   4.580000000 |
| instance method invocation        |   0.509000000 |
| inherited method invocation       |   0.509000000 |
| class method invocation           |   0.577000000 |
| inherited class method invocation |   1.305000000 |
|---------------------------------------------------|