首页 \ 问答 \ Netty数据流性能+ websocket性能(Netty data streaming performance + websocket performance)

Netty数据流性能+ websocket性能(Netty data streaming performance + websocket performance)

我想查看netty的一些特定性能数字,并查看netty网站上相关文章部分中的各个链接。

但是大多数人都谈到了与网络服务器同时连接的数量,而不是关于数据传输速率或类似的东西 ,我希望看一下。

此外,任何特定于netty websocket服务器的性能数字? (据我所知,它可能在某种程度上依赖于websocket协议,是吗?)

如果有人做了一些工作/在网络上看到了两个领域中的任何一个,他们可以分享一些数据/见解吗?


I wanted to look at some particular performance numbers for netty and have looked over the various links in the related articles section on the netty website.

But most of them talk about the number of simultaneous connections to a netty server and not about the data transfer rate or something similar which I wish to look over.

Also , any performance numbers specifically for a netty websocket server ? (I understand it may depend on the websocket protocol used as well to some extent , is it ?)

If someone has done some work / seen some links on the web in any of the 2 areas , could they please share some data numbers / insights ?


原文:https://stackoverflow.com/questions/11645450
更新时间:2023-04-26 06:04

最满意答案

你正在寻找的是一个功能模板和可变参数模板(a / k / a参数包)

template<class ... Args>
void f(Args ... args)
{
    std::cout << sizeof...(args) << "\n";
}

int main()
{
    f(0, 1, 2); // prints 3
    f(0, 1, 2, 3, 4); // prints 5
}

这通常不是您默认使用的。 考虑使用范围:

template<class Iterator>
void f(Iterator begin, Iterator end)
{
    std::cout << std::distance(begin, end) << "\n";
}

这更具惯用性。


What you're looking for is a function-template in conjunction with variadic templates (a/k/a parameter packs):

template<class ... Args>
void f(Args ... args)
{
    std::cout << sizeof...(args) << "\n";
}

int main()
{
    f(0, 1, 2); // prints 3
    f(0, 1, 2, 3, 4); // prints 5
}

This is generally not what you would use by default. Consider using ranges:

template<class Iterator>
void f(Iterator begin, Iterator end)
{
    std::cout << std::distance(begin, end) << "\n";
}

which is more idiomatic.

相关问答

更多
  • 这是C ++ - ic的方法:(C ++需要一个'pythonic') 标准库包括 ,这是一个允许您轻松完成此操作的标题。 首先,必须包含 ,它提供std::function , std::placeholders和std::bind 。 function具有以下定义: std::function f; 不幸的是,你的类或包装器函数不能使用任何类型的函数,你需要知道你打算使用的任何函数的返回类型或 ...
  • 你正在寻找的是一个功能模板和可变参数模板(a / k / a参数包) : template void f(Args ... args) { std::cout << sizeof...(args) << "\n"; } int main() { f(0, 1, 2); // prints 3 f(0, 1, 2, 3, 4); // prints 5 } 这通常不是您默认使用的。 考虑使用范围: template v ...
  • 您可能对通用中继功能感到满意: 住在科利鲁 #include int foo1(int device_number, const char*) { std::cout << __PRETTY_FUNCTION__ << "\n"; return device_number*42; } double foo2(int device_number) { std::cout << __PRETTY_FUNCTION__ << "\n"; return dev ...
  • 你可以创建一个以unit为参数的函数,如下所示: fun initBTree () = E 并像这样称呼它: initBTree () 它有类型 fn : unit -> tree 如果E有类型tree 。 虽然这没什么意义。 你可能只是说E ,或者如果你真的想把它叫做initBTree: val initBTree = E You can make a function that takes unit as its parameter, like this: fun initBTree () = ...
  • 你有没有试过看roxygen的Curry功能? > library(roxygen) > Curry function (FUN, ...) { .orig = list(...) function(...) do.call(FUN, c(.orig, list(...))) } 用法示例: > aplusb <- function(a,b) { + a + 2*b + } > oneplusb <- Curry(a ...
  • 如果这些值无效或稍后会导致异常,则接受的做法如下所示: if( i < 0 ) throw new ArgumentOutOfRangeException("i", "parameter i must be greater than 0"); if( string.IsNullOrEmpty(s) ) throw new ArgumentNullException("s","the paramater s needs to be set ..."); 所以基本参数例外列表如下: Argume ...
  • 您可以声明参数的默认值: function addDate($years, $months = 0, $days = 0) 这样你不需要指定那些或者像'addDate(2,0,0)'那样调用你的函数 参见http://php.net/manual/functions.arguments.php You can declare default values for parameter: function addDate($years, $months = 0, $days = 0) This way yo ...
  • 基本情景 定义函数时, ()区域用于输入。 这些输入映射到发送的数据。 function newFunction(data, status){ } newFunction(1,2); 在这种情况下, data将被赋值为1 ,而status将被赋值为newFunction范围的值2 。 输入不匹配 但是,它并不总是直接映射。 如果发送的参数较少,则未分配的输入变量将变为undefined 。 function newFunction(data, status){ } newFunction(1); 在这种 ...
  • 你可以看到参数列表 args(function) 请注意,当您为lapply执行此lapply ,您会得到: args(lapply) function (X, FUN, ...) 这三个点(...)意味着您可以将可选参数添加到作为参数传递给lapply的函数中,因此可能有额外的参数不是lapply直接参数。 You can see the list of arguments with args(function) Notice that, when you do that for lapply, ...
  • Common Lisp提供函数FUNCTION-LAMBDA-EXPRESSION ,它可以恢复源表达式,然后包含lambda表。 LispWorks定义了一个返回arglist的函数FUNCTION-LAMBDA-LIST 。 许多其他实现在某些内部软件包中具有某种形式的ARGLIST功能。 许多Common Lisp用户使用SLIME,这是GNU Emacs编辑器的一个非常聪明的编辑器扩展。 它有一个名为SWANK的Common Lisp后端。 SWANK源为各种Common Lisp实现提供了各种接口 ...

相关文章

更多

最新问答

更多
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • Java中的不可变类(Immutable class in Java)
  • 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
  • linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
  • Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
  • 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
  • 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
  • Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
  • EXCEL VBA 基础教程下载
  • RoR - 邮件中的动态主体(部分)(RoR - Dynamic body (part) in mailer)
  • 无法在Google Script中返回2D数组?(Can not return 2D Array in Google Script?)
  • JAVA环境变量的设置和对path , classpth ,java_home设置作用和目的?
  • mysql 关于分组查询、时间条件查询
  • 如何使用PowerShell匹配运算符(How to use the PowerShell match operator)
  • Effective C ++,第三版:重载const函数(Effective C++, Third edition: Overloading const function)
  • 如何用DELPHI动态建立MYSQL的数据库和表? 请示出源代码。谢谢!
  • 带有简单redis应用程序的Node.js抛出“未处理的错误”(Node.js with simple redis application throwing 'unhandled error')
  • 使用前端框架带来哪些好处,相对于使用jquery
  • Ruby将字符串($ 100.99)转换为float或BigDecimal(Ruby convert string ($100.99) to float or BigDecimal)
  • 高考完可以去做些什么?注意什么?
  • 如何声明放在main之后的类模板?(How do I declare a class template that is placed after the main?)
  • 如何使用XSLT基于兄弟姐妹对元素进行分组(How to group elements based on their siblings using XSLT)
  • 在wordpress中的所有页面的标志(Logo in all pages in wordpress)
  • R:使用rollapply对列组进行求和的问题(R: Problems using rollapply to sum groups of columns)
  • Allauth不会保存其他字段(Allauth will not save additional fields)
  • python中使用sys模块中sys.exit()好像不能退出?
  • 将Int拆分为3个字节并返回C语言(Splitting an Int to 3 bytes and back in C)
  • 在SD / MMC中启用DDR会导致问题吗?(Enabling DDR in SD/MMC causes problems? CMD 11 gives a response but the voltage switch wont complete)
  • sed没有按预期工作,从字符串中间删除特殊字符(sed not working as expected, removing special character from middle of string)
  • 如何将字符串转换为Elixir中的函数(how to convert a string to a function in Elixir)