Hello World!! I am Mohit Mohan, junior at Computer Science department at IIT Kanpur. I got selected in Google Summer of Code '20 to work with Open Printing under The Linux Foundation on the project Speed Optimisations for cups-browsed.
Cups-browsed, a daemon for browsing and filtering printers available on a network. But the time taken to create print queues for all the printers increases greatly as the number of printers increases. So from a users' perspective it is important to reduce the time taken to create the queues. Thus multi-threading is the way to do it, as we make some part of the code to run parallelly so that we can decrease the time it takes to create the queues for the printers.
- Testing cups-browsed with different number of printers: Tested cups-browsed with different number of printers to find how much time it takes to create print queues for all printers and in which part of code it takes most of the time. I used scripts running various instances of ippeveprinter to emulate printers on my systems.
- Design document for implementing multi-threading: We figured out the approach to implement multi-threading in cups-browsed. To ease this and for future developers to reference, drafted a design document for it.
- Parallelised handling of discovered printer instances: As we discover printer instances through Avahi, instead of passing resolve_callback() as callback, we pass resolver_wrapper() and it will create a new thread for calling resolve_callback(). With this approach we can process printer instances faster.
- Parallelised queue creation for the printers: To create a queue, created function create_queue() that will be called in a new thread from update_cups_queues() suitably.
Commits can be found at this link.
There are some things that we plan to do:
- Optimising the current code, so that we can improve upon time taken to create queues even more.
- Parallelise other events for cups-browsed, such as job processing and printer deletion.
I would like to thank my mentors Till Kamppeter and Deepak Patankar for guiding and helping me in this project. It was great experience working and communicating with them. I would also like to thank Aveek Basu for providing me this opportunity to have a very productive summer.