1
0
mirror of https://github.com/hybridgroup/gobot.git synced 2025-05-01 13:48:57 +08:00

3 Commits

Author SHA1 Message Date
Thomas Kohler
421135fcc2 BUGFIX/IMPROVEMENT: sysfs accesser 2022-11-09 17:30:57 +01:00
Thomas Kohler
45abf11acc BUGFIX: tests with sysfs mocks 2022-10-30 18:47:56 +01:00
Brian Stengaard
642ab409c1 Use Seek to speed up read/write in sysfs
This maintains `direction` and `value` `File`s for each DigitalPin
implementation. Instead of Open/Read/Close we now only do Seek/Read,
this speeds up Read/Write operations a bit.

A silly benchmark on the mock FS gives:

benchmark                  old ns/op     new ns/op     delta
BenchmarkDigitalRead-8     647           7.36          -98.86%

benchmark                  old allocs     new allocs     delta
BenchmarkDigitalRead-8     5              0              -100.00%

benchmark                  old bytes     new bytes     delta
BenchmarkDigitalRead-8     96            0             -100.00%
2016-02-18 21:18:45 +01:00