robotdotnet / WPILib

DotNet implementation of WPILib for FIRST Robotics Competition (FRC)
27 stars 8 forks source link

Driver Station Performance Improvements #97

Closed ThadHouse closed 8 years ago

ThadHouse commented 8 years ago

The old driver station code had some performance issues. It would cache the data under lock, which would take about 5ms. In addition, only 1 thread could read from the cache at one time, which could be a problem. So the code was changed to use a ReaderWriterLockSlim, as writes are called much less then reads. The second commit changes the code to use a cache to pull the data from the HAL, and then grabs the lock and does a reference change, which can happen much quicker.

codecov-io commented 8 years ago

Current coverage is 35.62%

Merging #97 into master will increase coverage by +0.31% as of 977c40a

@@            master     #97   diff @@
======================================
  Files          121     121       
  Stmts         7884    7949    +65
  Branches       982     985     +3
  Methods          0       0       
======================================
+ Hit           2784    2832    +48
  Partial        146     146       
- Missed        4954    4971    +17

Review entire Coverage Diff as of 977c40a

Powered by Codecov. Updated on successful CI builds.

ThadHouse commented 8 years ago

I pushed these fixes upstream as well. Don't know if they'll get merged, but they might. I saw performance improvements for sure, so I might merge this after a few days of testing.

ThadHouse commented 8 years ago

Since this actually fixes bugs, I've done some testing and it works better. Merging, closing #98.