Comments (12)
Oh, i forgot to push one commit with tiny refactoring.
It doesn't change interface or stability, but adds some doc and choses faster compression parameters.
So you may already test library.
from gorpc.
The current version of go-funz hangs gorpc tests - see https://github.com/valyala/gorpc/tree/go-funlz . Could you look into it?
from gorpc.
I've fixed it: looks like without some mark on Flush there is no simple way to prevent blocking on Read when bufio.Reader used. So i introduce Flush mark by stealing 0x00 from literal tag.
from gorpc.
found another error, not fixed yet
from gorpc.
Now BenchmarkRealApp sometimes fails with the error:
bench_test.go:155: Unexpected response type <nil>
Currently funlz uses more CPU comparing to flate compression and it has worse compression ratio in BenchmarkRealApp:
Client stats for 1K workers, 50K requests:
funlz: 29748 ns/op, 2822578 bytes written, 2829651 bytes read
flate: 27086 ns/op, 770926 bytes written, 849752 bytes read
Client stats for 10K workers, 50K requests:
funlz: 30193 ns/op, 2826387 bytes written, 2847577 bytes read
flate: 27379 ns/op, 732908 bytes written, 804311 bytes read
from gorpc.
Now BenchmarkRealApp sometimes fails with the error:
That is why i closed pull request. I can reproduce data corruption, but not yet found reason.
Currently funlz uses more CPU comparing to flate compression and it has worse compression ratio in BenchmarkRealApp
It has worser ratio cause it is simpler, it is intentional. It could be improved by editing constant and function in doc.go . By the way, what is the size of uncompressed data?
It looks strange that flate uses less CPU. Perhaps it cause of worser compression rate, so more data should be transmitted. I really don't know what to say.
Can we discuss in Russian?
from gorpc.
By the way, what is the size of uncompressed data?
4743950 bytes read, 4743970 bytes written
It looks strange that flate uses less CPU. Perhaps it cause of worser compression rate, so more data should be transmitted.
No, with flate gorpc transmits 3 times less data comparing to funlz. See the numbers from my previous message.
Can we discuss in Russian?
Да, но тогда многие посетители не поймут, что мы тут обсуждаем )
from gorpc.
It looks strange that flate uses less CPU. Perhaps it cause of worser compression rate, so more data should be transmitted.
No, with flate gorpc transmits 3 times less data comparing to funlz. See the numbers from my previous message.
I mean, funlz has lower compression rate :-)
4743950 bytes read, 4743970 bytes written
So funlz can save ~40%, but flate saves much more... perhaps it is cause of small window and tuning for speed.
I will fix data coruption, and then i'll change format to use 8192 byte window (it will be closer to original lzf). Then will test again :-)
from gorpc.
Good day, Aliaksandr.
I think i've fixed data coruption in https://github.com/funny-falcon/go-funlz , and have fixed a bug which leads to poor compression ratio.
Can you test it again?
And there is number of tuning params in doc.go. Currently they are set for fastest compression, but poorer compression ratio. You may play with them.
Also Writer now has WriteByte method and Reader has ReadByte method - gob encoder/decoder likes presence of such methods. Perhaps it worths to test without wrapping them with bufio.Writer and bufio.Reader.
from gorpc.
Now go-funlz uses the same CPU as compress/flate , but the compression ratio is still worser with default settings on BenchmarkRealApp:
go-funlz, 1k workers: read: 37 bytes/call, written: 32 bytes/call
go-funlz, 10k workers: read: 24 bytes/call, written: 22 bytes/call
go-funlz, 100k workers: read: 25 bytes/call, written: 24 bytes/call
compress/flate, 1k workers: read: 17 bytes/call, written: 15 bytes/call
compress/flate, 10k workers: read: 16 bytes/call, written: 14 bytes/call
compress/flate, 100k workers: read: 17 bytes/call, written: 16 bytes/call
Also Writer now has WriteByte method and Reader has ReadByte method - gob encoder/decoder likes presence of such methods. Perhaps it worths to test without wrapping them with bufio.Writer and bufio.Reader.
I tried disabling wrapper buffer for go-funlz, but this led to slightly higher CPU usage (from 26us/op to 27us/op).
from gorpc.
I added debug line in benchmark tests, so you could tune go-funlz - see 5f288fd .
from gorpc.
Closing the issue, since there is no recent activity on it.
from gorpc.
Related Issues (20)
- thread-safe? HOT 2
- Build is breaking under go older than 1.4 HOT 2
- Dispatcher type validation is probably a bit too strict (bug) HOT 2
- Dealing with time.Time HOT 3
- Is it possible to add support of struct{}? HOT 2
- bidirectional support HOT 3
- Typo in dispatcher.go fatal log HOT 1
- windows call timeout HOT 3
- Can not register service after the server listens
- Dispatcher.AddService: allow clients to register interfaces
- does gorpc support multi languages?
- Consider exposing gorpc.Server.ServeConn HOT 1
- How to coordinate physically seperate servers and clients HOT 2
- ConnStats.Snapshot example please
- WS supporting
- the docs make me confused, is there any project for reference? HOT 2
- Is this still a better choice than golang roc? HOT 2
- Custom Encoding
- Client connection cause server panic on ARM HOT 2
- add benchmark results to docs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gorpc.