-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Далбеев Георгий / ИТМО DWS / Stage 1 #12
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5266 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5278 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5278 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5753 lines exceeds the maximum allowed for the inline comments feature.
|
||
Entry<MemorySegment> entry = new BaseEntry<>( | ||
key, | ||
MemorySegment.ofArray(request.getBody()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ключ провалидировали, но не хватает проверки тела на null. Иначе получается можно записать tombstone, тем самым удалив запись.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил.
return new Response(Response.BAD_REQUEST, Response.EMPTY); | ||
} | ||
|
||
Entry<MemorySegment> entry = dao.get(key); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Здесь и ниже в delete не обрабатываются возможные исключения DAO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил.
|
||
public NewServer(ServiceConfig config) throws IOException { | ||
super(configureServer(config)); | ||
dao = new ReferenceDao(new Config(config.workingDir(), FLUSH_THRESHOLD)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Лучше всего передавать ReferenceDao в конструктор NewServer и делать все это в NewService.
Так будет более гибко и полезно для юнит тестов, например.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил.
|
||
public class NewServer extends HttpServer { | ||
|
||
private final ReferenceDao dao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему конкретный класс, а не интерфейс?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Исправил.
request = function() | ||
local headers = {} | ||
headers["Host"] = "localhost" | ||
local id = math.random(1, 1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Очень мало ключей для нагрузочного тестирования. Можно ли доверять результатам?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, я ошибся нужно было поставить выше чем rps. из-за этого скорее всего джит оптимизировал, и результаты не совсем корректные.
### Профилирование put | ||
#### CPU | ||
Библиотека one-nio затратила 20.81% на работу с запросами. | ||
Операции записи ответа в сокет занимают всего 2.26%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему 2.26, а не 14.03? А куда ушли остальные проценты?
Операции записи ответа в сокет занимают всего 2.26%. | ||
Операции сравнения MemorySegment занимают 11.31%. | ||
#### Alloc | ||
На созание MemorySegment затраивается 10.77%. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Во время какой операции происходят эти аллокации MemorySegment?
Операции сравнения MemorySegment занимают 11.31%. | ||
#### Alloc | ||
На созание MemorySegment затраивается 10.77%. | ||
Основне аллокации происходят на one-nio. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В процентном соотношении, на какие подоперации? парсинг заголовков, запросов и тп...
Хотелось бы увидеть более подробный аналитический отчет.
На созание MemorySegment затраивается 10.77%. | ||
Основне аллокации происходят на one-nio. | ||
|
||
### Профилирование get |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
при какой нагрузке - bad или normal, был снят профиль?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5773 lines exceeds the maximum allowed for the inline comments feature.
7/15 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 5773 lines exceeds the maximum allowed for the inline comments feature.
* stage1 * stage1 * stage1 * report stage1 * fix issues --------- Co-authored-by: georgiidalbeev <[email protected]> Co-authored-by: Roman Mushchinskii <[email protected]>
* stage1 * stage1 * stage1 * report stage1 * fix issues --------- Co-authored-by: georgiidalbeev <[email protected]> Co-authored-by: Roman Mushchinskii <[email protected]>
No description provided.