We study the spherical collapse of non-top-hat matter fluctuations in the presence of
dark energy with arbitrary sound speed. The model is described by a system of partial differential
equations solved using a pseudo-spectral method with collocation points. This method can reproduce
the known analytical solutions in the linear regime with an accuracy better than 10-6% and
better than 10-2% for the virialization threshold given by the usual spherical collapse
model. We show the impact of nonlinear dark energy fluctuations on matter profiles, matter
peculiar velocity and gravitational potential. We also show that phantom dark energy models with
low sound speed can develop a pathological behaviour around matter halos, namely negative energy
density. The dependence of the virialization threshold density for collapse on the dark energy
sound speed is also computed, confirming and extending previous results in the limit for
homogeneous and clustering dark energy.