PurposeCycle time reduction is important for order fulling process but often subject to resource constraints. This study considers an unrelated parallel machine environment where orders with random demands arrive dynamically. Processing speeds are controlled by resource allocation and subject to diminishing marginal returns. The objective is to minimize long-run expected order cycle time via order schedule and resource allocation decisions.Design/methodology/approachA stochastic optimization algorithm named CAP is proposed based on particle swarm optimization framework. It takes advantage of derived bound information to improve local search efficiency. Parameter impacts including demand variance, product type number, machine speed and resource coefficient are also analyzed through theoretic studies. The algorithm is evaluated and benchmarked with four well-known algorithms via extensive numerical experiments.FindingsFirst, cycle time can be significantly improved when demand randomness is reduced via better forecasting. Second, achieving processing balance should be of top priority when considering resource allocation. Third, given marginal returns on resource consumption, it is advisable to allocate more resources to resource-sensitive machines.Originality/valueA novel PSO-based optimization algorithm is proposed to jointly optimize order schedule and resource allocation decisions in a dynamic environment with random demands and stochastic arrivals. A general quadratic resource consumption function is adopted to better capture diminishing marginal returns.