X-ray free-electron lasers (XFELs) may allow to employ the single particle imaging (SPI) method to determine the structure of macromolecules that do not form stable crystals. Ultrashort pulses of 10 fs and less allow to outrun complete disintegration by Coulomb explosion and minimize radiation damage due to nuclear motion, but electronic damage is still present. The major contribution to the electronic damage comes from the plasma generated in the sample that is strongly dependent on the amount of Auger ionization. Since the Auger process has a characteristic time scale on the order of femtoseconds, one may expect that its contribution will be significantly reduced for attosecond pulses. Here, we study the effect of electronic damage on the SPI at pulse durations from 0.1 fs to 10 fs and in a large range of XFEL fluences to determine optimal conditions for imaging of biological samples. We analyzed the contribution of different electronic excitation processes and found that at fluences higher than $10^{13}$-$10^{15}$ photons/$mu$m$^2$ (depending on the photon energy and pulse duration) the diffracted signal saturates and does not increase further. A significant gain in the signal is obtained by reducing the pulse duration from 10 fs to 1 fs. Pulses below 1 fs duration do not give a significant gain in the scattering signal in comparison with 1 fs pulses. We also study the limits imposed on SPI by Compton scattering.