Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reuse the TCP socket and buffer IO to improve performance #32

Merged
merged 30 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30e0316
asdf
fonsp Jan 24, 2023
3364f38
Merge branch 'main' into reuse-connection
fonsp Jan 24, 2023
2a7cd2e
asdfasdfasdf
fonsp Jan 24, 2023
24806f9
asdf
fonsp Jan 24, 2023
7a6f58f
Merge branch 'main' into reuse-connection
fonsp Jan 24, 2023
e439dbe
Make it super fast!! Thank you Nehal 💛
fonsp Jan 24, 2023
16b934f
BufferedIO to buffer without allocating too much
fonsp Jan 26, 2023
7689f57
improve error messages
fonsp Jan 26, 2023
862547b
rethrow deserialization errors
fonsp Jan 26, 2023
438aacd
Merge branch 'main' into reuse-connection
fonsp Jan 27, 2023
dbee373
Update Malt.jl
fonsp Jan 27, 2023
a631a0a
Remove BufferedIO 💔
fonsp Jan 27, 2023
2eb4a72
basic one-way channel implementation
fonsp Jan 27, 2023
b7c11de
Message boundary & fix Base.buffer_writes usage
Pangoraw Jan 27, 2023
9c356ff
some refactors, attempts at better handling of REPL interrupts
fonsp Jan 27, 2023
bc53a12
rework exception handling more
fonsp Jan 27, 2023
78857ca
interrupt improvement on Julia 1.9
fonsp Jan 27, 2023
bc8d408
Use `Serialization.Serializer`
Pangoraw Feb 22, 2023
4a25686
Merge branch 'main' into reuse-connection
Pangoraw Feb 22, 2023
08daa92
Merge branch 'main' into reuse-connection
Pangoraw Feb 23, 2023
b0a2a59
clean up some logs
fonsp Mar 7, 2023
934a771
Benchmark: higher tolerance for Expr 3
fonsp Mar 7, 2023
b128bd7
Remove broken interrupt on Windows :(
fonsp Mar 7, 2023
0828bb4
Reset custom value for BUFFER_SIZE?
fonsp Mar 7, 2023
c12d239
Revert "Use `Serialization.Serializer`"
fonsp Mar 7, 2023
52bccb8
use strict max_ratio again for benchmarks
fonsp Mar 7, 2023
3d49257
Worker: stop listening after connection
fonsp Mar 13, 2023
c63a62e
Workaround julia#37154
fonsp Mar 13, 2023
790fa75
Merge branch 'reuse-connection' into reuse-connection-stop-listening
fonsp Mar 13, 2023
48dfa9f
Merge pull request #42 from JuliaPluto/reuse-connection-stop-listening
fonsp Mar 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
# We test quite a lot of versions because we do some OS and version specific things unfortunately
julia-version: ['1.6', '1.7', '1.8', 'nightly']
julia-version: ['1.6.5', '1.7', '1.8', 'nightly']
os: [ubuntu-latest, macOS-latest, windows-latest]

steps:
Expand Down
3 changes: 2 additions & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ julia = "^1.6"
[extras]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Distributed", "BenchmarkTools"]
test = ["Test", "Distributed", "BenchmarkTools", "Random"]
51 changes: 51 additions & 0 deletions messages.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@



Connection:

1. The host starts a Julia process for the worker
2. The worker finds a free port and starts a TCP server
3. The worker writes the chosen port to stdout
4. The host reads the port number from stdout
5. The host connects to the worker's server, we now have an open TCP socket

Communication (either direction):

1. Send `msg_type::UInt8`
2. Send `message_id::UInt64`
3. Send your message data
4. (Not yet implemented) send the message boundary



Message data:

from_host_call_with_response

(f, args, kwargs, respond_with_nothing::Bool)

from_host_call_without_response

(f, args, kwargs, this_value_is_ignored::Bool)


from_host_fake_interrupt
# (this is not yet implemented)
()




from_worker_call_result

result

from_worker_call_failure

result






Loading