Homework 0 forum

Performance for HW0

 
Picture of Aaron Joos Lippeveldts
Performance for HW0
by Aaron Joos Lippeveldts - Tuesday, 22 September 2020, 19:38
 

Hi,

I was wondering to what extent performance is important for HW0.

For example, is it okay if processing of messages is not yet parallelized,
or if you resolve peer addresses and connect to the socket again for every message?

Or should these things already be optimized as much as possible?


Thanks

Picture of Cristina Basescu
Re: Performance for HW0
by Cristina Basescu - Wednesday, 23 September 2020, 08:58
 

Hi Aaron,

is it okay if processing of messages is not yet parallelized

I wouldn't recommend designing your gossiper that way. You might pass all tests for homework 0, but you definitely need parallel processing for later homeworks - and in general when designing a server.

or if you resolve peer addresses and connect to the socket again for every message?

That seems acceptable, because inter-peer communication is over UDP, thus there's no connection state or handshake overhead. However, it's not easier or more practical than the alternative. Instead, you could use the same UDP connection object that the gossiper listens on also for sending UDP packets, which would likely make it more convenient to close just one object (when the gossiper exits) instead of multiple ones.  

Cristina