hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

Close JsonWriters. Caused speed up? #149

Closed gjvanderheiden closed 2 years ago

gjvanderheiden commented 2 years ago

see: [#148]

I use hap-java for my entire house. Everything is KNX, so pretty much accessories. Sometimes the accessories turn red and says "device not responding" (or something like that, get it in dutch). Also sometimes it takes a while, which makes no sense, because I cache all KNX values. I use a version with another pr request in it [#130]. Also I updated all dependencies in my local build of HAP-Java. No "device not responding" anymore and seems to react a lot faster.

So I'm not sure if closing JsonWriters did the trick. It can't hurt also. And in the close() operation of JsonWriter you see a flush. ByteArrayBuffer was closed, but that doesn't do anything.

I stole this idea from pr [#116]. That pr fixed it on one occurrence, but I found 3 more, by searching on usages of createWriter().

gjvanderheiden commented 2 years ago

Started my own hap implementation, pr requests are merged waaaay to slow.