Many physics analyses using the Compact Muon Solenoid (CMS) detector at the LHC require accurate electron and photon energy measurements. Excellent energy resolution is crucial for the study of Higgs boson decays with electromagnetic particles in the final state, as well as searches for very high mass resonances decaying to energetic photons or electrons. The CMS electromagnetic calorimeter (ECAL) is presently operating at the LHC with proton-proton collisions at 13 TeV center-of-mass energy, 25 ns bunch spacing, and an unprecedented instantaneous luminosity. High pileup levels and the ageing of crystals from exposure to large particle fluencies necessitate a retuning of the ECAL readout, trigger thresholds, and reconstruction algorithms, to maintain the best possible performance in these increasingly challenging conditions. In addition, the energy response of the detector must be precisely calibrated and monitored, injecting laser light to correct for crystal transparency changes due to irradiation. A dedicated calibration of each detector channel is performed with physics events exploiting electrons from W and Z boson decays, photons from pi0 decays, and from the azimuthally symmetric energy distribution of minimum bias events. This talk presents the new reconstruction algorithm and calibration strategies that have been implemented and the excellent performance achieved by the CMS ECAL throughout LHC Run II.