experiment: Оптимизация сабсистем#8476
experiment: Оптимизация сабсистем#8476dageavtobusnick wants to merge 37 commits intoss220-space:master220from
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces optimizations for subsystems and icon generation. However, a critical security concern has been identified: a high-severity path traversal vulnerability exists in the new icon generation logic. This is due to the use of unsanitized atom names to construct file paths on the server, which could lead to sensitive file overwrites or the creation of malicious content in arbitrary locations. Beyond the security vulnerability, the review also highlighted a critical issue with an incorrect stage definition for the event subsystem in code/controllers/subsystem/events.dm, which will cause only one processing stage to execute. Recommendations include correcting the random color generation loop in code/__HELPERS/icons.dm which performs 7 iterations instead of 6, and addressing the unsafe suspension implementation in the http subsystem in code/controllers/subsystem/http.dm.
Ты это к чему? Для констант я использую _alt варианты, В которых остается конкатинация. Все же что в рантайме заменяются на интерполяцию, которая быстрее и вызывает меньше аллокаций. |
Мне страшно от того, что я понял, что ты сказал |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request primarily aims at optimizing various subsystems and span macros. However, a high-severity path traversal vulnerability was identified in the new icon generation logic, as the name parameter, derived from untrusted atom names, is used without sanitization for generating filenames, which could lead to arbitrary file writes on the server. Furthermore, the changes introduce critical errors such as unsafe POW2 and POW3 macros in code/__DEFINES/math.dm due to missing parentheses, and a typo in code/game/turfs/turf.dm where wind_y_cached is incorrectly assigned wind_x during wind vector calculation. While some changes, like the security fix in globals.dm, are beneficial, these critical issues need to be addressed.
|
/gemini review |
There was a problem hiding this comment.
Code Review
Upon reviewing the proposed changes, which technically look excellent, this pull request introduces several optimizations, including tick checks in subsystems and improved icon generation. However, two security vulnerabilities were identified: a potential Arbitrary File Read in the spritesheet generation system due to unsafe use of fcopy() with unvalidated icon paths, and a Log Injection vulnerability in the HTTP subsystem where untrusted response bodies are logged without sanitization. Additionally, it is recommended to use interpolation macros for all span_ calls where technically possible, as the current use of _alt macros with string concatenation may reduce optimization effectiveness.
|
/gemini review |
There was a problem hiding this comment.
Code Review
Аналитический отчёт от Большого Брата. Обработка запроса завершена.
Приветствую! Я проанализировал предложенные Вами изменения. С технической точки зрения, работа выглядит отлично. Вы проделали масштабную работу по оптимизации производительности и повышению стабильности кодовой базы, что заслуживает высокой оценки. Замена конкатенации строк на интерполяцию, кеширование списков, использование макросов для математических операций и рефакторинг подсистем events и http для поддержки паузы — всё это значимые улучшения. Особенно важны многочисленные исправления, связанные с утечками памяти, путём добавления и улучшения процедур Destroy().
Сводка анализа:
- 🔴 Критических замечаний: 1
- 🟡 Рекомендаций: 1
- 💡 Предложений: 0
Я обнаружил одно критическое место, которое может привести к ошибке выполнения, и одну возможность для дальнейшей оптимизации. Пожалуйста, ознакомьтесь с комментариями к отдельным строкам кода для получения более подробной информации.
Спасибо за ваш вклад в проект!
421defa to
18a0ab2
Compare
…aradise into optimisation_2
|
!build_rust |
Что этот ПР делает
Добавляет проверки на тик мастера в http и events сабсистемы.
Оптимизирует генерацию иконок для лут панели за счет иконфорджа.
Оптимизирует спаны за счет замены тех, что вызываются в рантайме с конкатинации на интерполяцию.
Оптимизирует количество списков строк за счет их кеширования
Оптимизирует операции возведения во вторую и третью степень путем замены на умножение.