thriftrw / thriftrw-python

A Thrift encoding library for Python
MIT License
36 stars 10 forks source link

Reduce Python interaction during serialization #109

Closed abhinav closed 8 years ago

abhinav commented 8 years ago

This very slightly improves the serialization performance.

Before:

--------------------------------------------- benchmark: 2 tests ---------------------------------------------
Name (time in ms)          Min       Max      Mean  StdDev    Median      IQR  Outliers(*)  Rounds  Iterations
--------------------------------------------------------------------------------------------------------------
test_binary_dumps     123.0109  130.0850  125.1512  2.0382  124.6510   1.6854          6;3      25           1
test_binary_loads     489.0878  517.9942  501.0961  7.9750  500.0012  12.7176          9;0      25           1
--------------------------------------------------------------------------------------------------------------

After:

--------------------------------------------- benchmark: 2 tests --------------------------------------------
Name (time in ms)          Min       Max      Mean  StdDev    Median     IQR  Outliers(*)  Rounds  Iterations
-------------------------------------------------------------------------------------------------------------
test_binary_dumps     113.8060  124.3708  116.9059  3.3549  115.5560  1.4975          5;5      25           1
test_binary_loads     490.5999  505.4250  496.1776  3.5518  495.6250  4.5011          8;1      25           1
-------------------------------------------------------------------------------------------------------------
HelloGrayson commented 8 years ago

Mind posting some results? Are you doing benchmarks during travis?

abhinav commented 8 years ago

Added results

HelloGrayson commented 8 years ago

Builds are hanging... restarted it.

blampe commented 8 years ago

This is amazing.

cc @sunaaron as an FYI, this might help performance issues.