Opened 7 years ago

Closed 4 years ago

#55041 closed enhancement (fixed)

mpbb-list-subports is slow

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: admin@…
Priority: Normal Milestone:
Component: buildbot/mpbb Version:
Keywords: Cc: mojca (Mojca Miklavec)
Port:

Description (last modified by mojca (Mojca Miklavec))

Would be great if mpbb-list-subports could be made faster. Listing all subports of the php port takes 2 minutes 30 seconds on my 2016 MacBook Pro. Listing all of the py-* ports' subports took our buildbot 2 hours, listing the p5-* subports on the ppc buildbot took 26 hours. If we ever want to try to build all ports, at this rate, just listing the subports would probably take a week.

Change History (8)

comment:1 Changed 7 years ago by jmroot (Joshua Root)

This is a direct result of all the exclusion checks. Among other things, it queries the packages server with curl and runs port_binary_distributable.tcl for each subport.

comment:2 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

The curl check is probably already as fast as it can get, since it's just checking the response code from an http request to a server on the same gigabit network.

What about the rest? Each tcl script we run, and we run several for each subport, has to start tclsh and initialize the ports system. Is there a way we can initialize the ports system just once per subport and get all the information we need?

We have $(sysctl -n hw.activecpu) CPU cores. Is there a way we can check that many ports at the same time?

Version 0, edited 7 years ago by ryandesign (Ryan Carsten Schmidt) (next)

comment:3 in reply to:  2 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign:

Is there a way we can check that many ports in parallel?

e.g. with GNU parallel?

comment:4 Changed 7 years ago by mojca (Mojca Miklavec)

Curl might be as fast as is gets, but it would be even faster if we had a local database with all available files.

I don't know enough about Tcl to be able to tell how to avoid re-initializing everything every single time.

comment:5 in reply to:  4 Changed 7 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to mojca:

Curl might be as fast as is gets, but it would be even faster if we had a local database with all available files.

Maybe. Seems like something that could easily get out of sync. And how much time would this save? How quickly can we do a (SQLite?) database query? The curl check takes about 0.05 seconds, and it looks like we could cut that to 0.02 by using http instead of https.

I don't know enough about Tcl to be able to tell how to avoid re-initializing everything every single time.

I meant: instead of running archive-path.tcl and port_binary_distributable.tcl and portgroups.tcl and supported-archs.tcl for each subport, could we combine those into a single script? Move some of the logic from bash into Tcl? Even though we don't currently run all four scripts for all ports (some are run conditionally), I feel like probably most of the time is spent in initialization, such that combining them into a single script that does all four tasks would still be faster.

comment:6 Changed 6 years ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:7 Changed 5 years ago by mojca (Mojca Miklavec)

Description: modified (diff)

comment:8 Changed 4 years ago by jmroot (Joshua Root)

Component: server/hostingbuildbot/mpbb
Keywords: mpbb removed
Resolution: fixed
Status: newclosed

This is about as good as it's going to get now. If you want to check if each archive has been uploaded, there's no getting around the fact that getting the archive names requires executing each portfile.

Note: See TracTickets for help on using tickets.