The gait analysis of patients after surgery for tumors around the knee joint relies on the use of a three-dimensional motion capture system. However, obtaining long-term, free-standing, real-world gait data with three-dimensional gait analysis is challenging. In this study, we utilized a portable gait analyzer to collect gait data from patients who underwent rotating hinge knee megaprosthesis (RHK) and total knee arthroplasty (TKA), this study aims to compare via gait analysis patients who underwent megaprosthesis with patients with TKA. A retrospective study was conducted on eight patients with knee bone tumors (RHK group) and ten patients with knee osteoarthritis who underwent standard TKA (TKA group) from January 2018 to January 2022. Gait analysis, was conducted using the Intelligent Device for Energy Expenditure and Activity (IDEEA), and the results were compared with those of a healthy control group. The lower limb alignment of the RHK and TKA groups was evaluated, and the KSS scores of the two groups were collected and compared. Energy consumption during a 20-m walk was measured and compared among the RHK, TKA, and healthy control groups using one-way ANOVA. Paired t-tests were used to compare the operated and nonoperated limbs within groups. All patients exhibited slower walking speeds and cadence than the healthy control participants (p < 0.01), While no significant differences were found between the RHK and TKA groups. The single support time (521.15 ± 94.56 ms) of the RHK-operated limb was significantly shorter than that of the nonoperated limb (576.53 ± 77.40 ms, p = 0.004). The pulling acceleration of the RHK group (0.71 ± 0.27 G) was lower than that of the TKA group (1.04 ± 0.31 G, p = 0.029). The push-off angle in the RHK group (24.91° ± 10.91°) was significantly greater than that in the TKA group (10.64° ± 5.41°, p = 0.007). The RHK group showed significant differences between the operated and nonoperated limbs in terms of swing power, ground impact, footfall, and push-off. The RHK (0.03 ± 0.01 kcal/min/kg) and TKA (0.029 ± 0.01 kcal/min/kg) groups had significantly greater energy expenditures than did the healthy control group (0.02 ± 0.00 kcal/min/kg, p < 0.05). The comparison of HKA angles and KSS scores between the TKA and RHK groups showed statistically significant differences. A portable gait analyzer appears to be suitable for evaluating the effects of RHK. RHK patients demonstrate more pronounced gait abnormalities than TKA patients, reflected in greater energy expenditure, implying reduced walking efficiency. This suggests the need for increased energy expenditure in RHK patients to compensate for abnormal knee joint conditions during walking and maintain body balance.