For all experiments, 7- to 8-day-old pupae were sorted into glass tubes [70 mm × 5 mm × 3 mm (length × external diameter × internal diameter)] containing the same food used for rearing. After eclosion, animals were sorted according to their sex, and then the tubes were loaded into ethoscope “sleep arenas” (20 animals per device) (24). Three days of baseline were recorded before any treatment. All experiments were carried out under LD conditions (50 to 70% humidity) in incubators set at 25°C and with ad libitum access to regular food. Animals that died during the experiment were excluded from the analysis, except for the longevity experiments.

To evaluate the effect of mating on sleep (Fig. 3), a naïve male was introduced in the tube of each naive female and allowed to interact for 2 hours from ZT06 to ZT08 (zeitgeber time). After the interaction, males were removed and the activity profile of the females was recorded for another 3.5 days. The short duration of the interaction and the restrictive space of the glass tube reduce the probability of mating, and only about 50% of the flies underwent successful mating. This setup provides the two necessary groups: mated females and females that were courted but not mated. Effective mating was scored as the presence of larvae in the food 4 days after the interaction.

The “rotational module” of the ethoscope platform was used to perform the 12-hour dynamic sleep deprivation treatments shown in Fig. 5. Different durations of immobility were used to trigger the rotation of the tube, as listed in the figure (from 10 to 1000 s).

The effects of long-lasting dynamic sleep deprivation shown in Figs. 4 and 6 were tested using the “optomotor module,” programmed with a 20-s immobility trigger. Once a week, flies were transferred to a fresh tube to ensure good quality food during the entire experiment. For the experiment shown in Fig. 1C, the behavior of both males and females was recorded for 7 days and then transferred to fresh tubes and recorded for another 7 days. To avoid confounding effects related to the location of the tube on sleep amount (e.g., an ethoscope and incubator), the new position of all the tubes was systematically interspersed (60). Namely, low and high sleepers from the same experiment and sex were paired as neighbors in a new arena, and their behavior was recorded for another week. Comparison was between days 2 to 7 and days 8 to 13, ignoring the first day and the day after the change of tube. For the experiment shown in Fig. 4, once a week, flies were transferred to a fresh tube to ensure good quality food during the entire experiment. For the experiment shown in Fig. 6, sleep deprivation was stopped after 9.5 days of treatment, and animals were allowed to recover for 3 days in the ethoscopes at 25°C to measure sleep rebound.