Context. Despite recent progress, the question of what regulates the star formation efficiency (SFE) in galaxies remains one of the most debated problems in astrophysics. According to the dominant picture, star formation (SF) is regulated by turbulence and feedback, and the SFE is ~1–2% or less per local free-fall time on all scales from Galactic clouds to high-redshift galaxies. In an alternate scenario, the star formation rate (SFR) in galactic disks is linearly proportional to the mass of dense gas above some critical density threshold ~104 cm–3. Aims. We aim to discriminate between these two pictures thanks to high-resolution submillimeter and mid-infrared imaging observations, which trace both dense gas and young stellar objects (YSOs) for a comprehensive sample of 49 nearby massive SF complexes out to a distance of d ~ 3 kpc in the Galactic disk. Methods. We used data from CAFFEINE, a complete 350/450 µm survey with APEX/ArTéMiS of the densest portions of all southern molecular clouds at d ≲ 3 kpc, in combination with Herschel data to produce column density maps at a factor of ~4 higher resolution (8") than standard Herschel column density maps (36″). Our maps are free of any saturation effect around luminous high-mass pro-tostellar objects and resolve the structure of dense gas and the typical ~0.1 pc width of molecular filaments out to 3 kpc, which is the most important asset of the present study and is impossible to achieve with Herschel data alone. Coupled with SFR estimates derived from Spitzer mid-infrared observations of the YSO content of the same clouds, this allowed us to study the dependence of the SFE on density in the CAFFEINE clouds. We also combine our findings with existing SF efficiency measurements in nearby clouds to extend our analysis down to lower column densities. Results. Our results suggest that the SFE does not increase with density above the critical threshold and support a scenario in which the SFE in dense gas is approximately constant (independent of free-fall time). However, the SF efficiency measurements traced by Class I YSOs in nearby clouds are more inconclusive, since they are consistent with both the presence of a density threshold and a dependence on density above the threshold. Overall, we suggest that the SF efficiency in dense gas is primarily governed by the physics of filament fragmentation into protostellar cores.