TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: Oat++ – Zero-dependency C++ framework for high-performance web services

104 点作者 lganzzzo超过 6 年前

11 条评论

FooBarWidget超过 6 年前
Hi there, great work writing oat++. I am the author of Passenger (<a href="https:&#x2F;&#x2F;www.phusionpassenger.com" rel="nofollow">https:&#x2F;&#x2F;www.phusionpassenger.com</a>), an application server that powers 650.000 companies and sites world-wide such as Apple, Pixar, Juniper, etc. Passenger is mostly written in C++ and like you, performance is a priority for us.<p>I&#x27;ve done a fast code review, and I thought I&#x27;d share some of my findings with you. These are based on my experience with writing high-performance servers. You can read about some of my experience in these blog posts: <a href="https:&#x2F;&#x2F;www.rubyraptor.org&#x2F;how-we-made-raptor-up-to-4x-faster-than-unicorn-and-up-to-2x-faster-than-puma-torquebox&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.rubyraptor.org&#x2F;how-we-made-raptor-up-to-4x-faste...</a><p>Hopefully you can use my feedback to make oat++ even faster and better. Code review here: <a href="https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp&#x2F;issues&#x2F;15" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp&#x2F;issues&#x2F;15</a><p>I&#x27;ve covered:<p>- Pools and contention<p>- Shared_ptr and atomics everywhere<p>- List vs vector<p>- Zero-copy architecture<p>- SpinLock everywhere<p>- New does not return nullptr?<p>- More documentation<p>- More tests
评论 #18223361 未加载
评论 #18218514 未加载
评论 #18219460 未加载
lganzzzo超过 6 年前
The idea of the project is to give user something light, something that could cover a set of basic needs when you develop a web-service (Like rest-framework, basic DI-framework, web-client, connection management, object-mapping etc...) and make it highly customizable at the same time.<p>So when you need to kickoff something from scratch you don&#x27;t need to do anything more than a git clone starter-project and start coding. And when it comes time for additional requirements you cant easily substitute ex. any SSL backend, any http-client, add http compression etc... And oat++ provides interfaces to configure there things.<p>See more: Example how to create web-service with swagger-uI and auto-documented endpoints <a href="https:&#x2F;&#x2F;medium.com&#x2F;oatpp&#x2F;c-oatpp-web-service-with-swagger-ui-and-auto-documented-endpoints-1d4bb7b82c21" rel="nofollow">https:&#x2F;&#x2F;medium.com&#x2F;oatpp&#x2F;c-oatpp-web-service-with-swagger-ui...</a>
Chabs超过 6 年前
What is the rationale behind going for from-full-scratch instead of packaging a copy of ASIO with the library? Beating properly-used ASIO performance is going to be a massive uphill battle, especially in multithreaded scenarios.<p>On that note, benchmarks against a simple ASIO http server are a must if performance is your #1 stated goal.
评论 #18218039 未加载
评论 #18217959 未加载
评论 #18219322 未加载
评论 #18217965 未加载
lganzzzo超过 6 年前
Have you noticed oatpp ApiClient (retrofit-like client wrapper)? This is another trick oatpp&#x27;s ObjectMapper layer can do.<p>The oatpp-consul client is built using oatpp ApiClient. see ApiClient in the oatpp-consul <a href="https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp-consul&#x2F;blob&#x2F;master&#x2F;rest&#x2F;Client.hpp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp-consul&#x2F;blob&#x2F;master&#x2F;rest&#x2F;Clien...</a><p>example how to do client requests <a href="https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp-examples&#x2F;issues&#x2F;3" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oatpp&#x2F;oatpp-examples&#x2F;issues&#x2F;3</a><p>It is also possible to build your own RequestExecutor based on ex. Curl
Matthias247超过 6 年前
Looks pretty cool and easy to use, at least for the synchronous methods. The async methods could use a little bit more documentation, e.g. what is really async about them (what is Action? Some kind of deferred response? Can you store the request objects there for longer than the act() methods scope? Etc).<p>What I would also like to see there are additional examples which show how streaming the request&#x2F;response body is done, e.g. for file uploads and downloads or SSE.
评论 #18221701 未加载
clishem超过 6 年前
I wonder how this stacks against Cutelyst in terms of performance.
评论 #18211903 未加载
lganzzzo超过 6 年前
Did you notice that <a href="https:&#x2F;&#x2F;oatpp.io" rel="nofollow">https:&#x2F;&#x2F;oatpp.io</a> is served by oatpp :)?
评论 #18221664 未加载
评论 #18219008 未加载
评论 #18218675 未加载
评论 #18218698 未加载
ddorian43超过 6 年前
Have you tried using (or building on top of) seastar-framework ?
评论 #18218260 未加载
petters超过 6 年前
&gt; return createResponse(Status::CODE_200, &quot;Hello World!&quot;);<p>Is &quot;Status::CODE_200&quot; a useful abstraction over just &quot;200&quot;?
评论 #18219914 未加载
评论 #18219409 未加载
sytelus超过 6 年前
Is this cross platform? It looks like there is direct dependency on Linux socket APIs.
评论 #18218761 未加载
IloveHN84超过 6 年前
What about TLS 1.3?
评论 #18217992 未加载