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.

相关问答

更多

作为参数的函数(Functions as arguments)

这是C ++ - ic的方法:(C ++需要一个'pythonic') 标准库包括<functional> ,这是一个允许您轻松完成此操作的标题。 首先,必须包含<functional> ,它提供std::function , std::placeholders和std::bind 。 function具有以下定义: std::function<returntype(arg1type, argNtype)> f; 不幸的是,你的类或包装器函数不能使用任何类型的函数,你需要知道你打算使用的任何函数的...

我可以知道我的函数有多少参数?(Can I know how many arguments my function gets?)

你正在寻找的是一个功能模板和可变参数模板(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 Iterat...

“转换”函数参数(“Transforming” Function Arguments)

您可能对通用中继功能感到满意: 住在科利鲁 #include <iostream> 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"; retur...

没有参数的函数声明(Function declaration without arguments)

你可以创建一个以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 ...

如何绑定函数参数(How to bind function arguments)

你有没有试过看roxygen的Curry功能? > library(roxygen) > Curry function (FUN, ...) { .orig = list(...) function(...) do.call(FUN, c(.orig, list(...))) } <environment: namespace:roxygen> 用法示例: > aplusb <- function(a,b) { + a + 2*b + } > oneplusb <- Cu...

验证函数参数?(Validating function arguments?)

如果这些值无效或稍后会导致异常,则接受的做法如下所示: 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 ..."); 所以基本参数例外列表如下: A...

PHP:具有3个参数的函数>使用较少的参数(PHP: Function with 3 arguments > Use it with less arguments)

您可以声明参数的默认值: 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 w...

函数参数及其工作原理(Function arguments and how they work)

基本情景 定义函数时, ()区域用于输入。 这些输入映射到发送的数据。 function newFunction(data, status){ } newFunction(1,2); 在这种情况下, data将被赋值为1 ,而status将被赋值为newFunction范围的值2 。 输入不匹配 但是,它并不总是直接映射。 如果发送的参数较少,则未分配的输入变量将变为undefined 。 function newFunction(data, status){ } newFunction(1);...

函数中的其他参数(Additional arguments in a function)

你可以看到参数列表 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 lap...

函数需要多少个参数?(How many arguments does a function take?)

Common Lisp提供函数FUNCTION-LAMBDA-EXPRESSION ,它可以恢复源表达式,然后包含lambda表。 LispWorks定义了一个返回arglist的函数FUNCTION-LAMBDA-LIST 。 许多其他实现在某些内部软件包中具有某种形式的ARGLIST功能。 许多Common Lisp用户使用SLIME,这是GNU Emacs编辑器的一个非常聪明的编辑器扩展。 它有一个名为SWANK的Common Lisp后端。 SWANK源为各种Common Lisp实现提供...

相关文章

更多

Solr Performance Factors(Solr 性能因素)

Schema Design Considerations(数据模型方面考虑) indexed fiel ...

WebSocket实例详解

引用 WebSocket相关的jar包,由于本教程是使用maven集成的tomcat,而不是直接下载t ...

WebSocket介绍

WebSocket 规范的目标是在浏览器中实现和服务器端双向通信.双向通信可以拓展浏览器上的应用类型, ...

在SpringMVC中使用WebSocket

SpringMvc项目的搭建在这里就不做多解释,要在Spring中实现 WebSocket 必须加上 ...

Becoming a data scientist

Data Week: Becoming a data scientist Data Pointed, ...

Supra Skytop Shoes All White Gunny are a top performance

The Skytop “Crimson” is an all white leather affair ...

SOLR Performance Benchmarks – Single vs. Multi-core Index Shards

http://www.derivante.com/2009/05/05/solr-performanc ...

摘抄---Multimedia Streaming on Microsoft Windows CE 3.0

Multimedia Streaming on Microsoft Windows CE 3.0 ...

Hadoop Streaming

Hadoop版本:Hadoop-0.20.204 Hadoop的Streaming框架允许任何程序语言 ...

最新问答

更多

获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)

我用Google搜索了一个解决方案。 “EnumDisplayModeProvider”是我自己设置网站的各种模式的枚举。 public EnumDisplayModeProvider GetDisplayModeId() { foreach (var mode in DisplayModeProvider.Instance.Modes) if (mode.CanHandleContext(HttpContext)) {

如何通过引用返回对象?(How is returning an object by reference possible?)

这相对简单:在类的构造函数中,您可以分配内存,例如使用new 。 如果你制作一个对象的副本,你不是每次都分配新的内存,而是只复制指向原始内存块的指针,同时递增一个也存储在内存中的引用计数器,使得每个副本都是对象可以访问它。 如果引用计数降至零,则销毁对象将减少引用计数并仅释放分配的内存。 您只需要一个自定义复制构造函数和赋值运算符。 这基本上是共享指针的工作方式。 This is relatively easy: In the class' constructor, you allocate m

矩阵如何存储在内存中?(How are matrices stored in memory?)

正如它在“熵编码”中所说的那样,使用Z字形图案,与RLE一起使用,在许多情况下,RLE已经减小了尺寸。 但是,据我所知,DCT本身并没有给出稀疏矩阵。 但它通常会增强矩阵的熵。 这是compressen变得有损的点:输入矩阵用DCT传输,然后量化量化然后使用霍夫曼编码。 As it says in "Entropy coding" a zig-zag pattern is used, together with RLE which will already reduce size for man

每个请求的Java新会话?(Java New Session For Each Request?)

你是如何进行重定向的? 您是否事先调用了HttpServletResponse.encodeRedirectURL()? 在这里阅读javadoc 您可以使用它像response.sendRedirect(response.encodeRedirectURL(path)); The issue was with the path in the JSESSIONID cookie. I still can't figure out why it was being set to the tomca

css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)

我认为word-break ,如果你想在一个单词中打破行,你可以指定它,这样做可以解决问题: .column { word-break:break-all; } jsFiddle演示。 您可以在此处阅读有关word-break属性的更多信息。 I think word-break, with which you can specify if you want to break line within a word, will do the trick: .column { word-break

无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)

我认为您忘记在分类时间内缩放输入图像,如train_test.prototxt文件的第11行所示。 您可能应该在C ++代码中的某个位置乘以该因子,或者使用Caffe图层来缩放输入(请查看ELTWISE或POWER图层)。 编辑: 在评论中进行了一次对话之后,结果发现在classification.cpp文件中错误地删除了图像均值,而在原始训练/测试管道中没有减去图像均值。 I think you have forgotten to scale the input image during cl

xcode语法颜色编码解释?(xcode syntax color coding explained?)

转到: Xcode => Preferences => Fonts & Colors 您将看到每个语法高亮颜色旁边都有一个简短的解释。 Go to: Xcode => Preferences => Fonts & Colors You'll see that each syntax highlighting colour has a brief explanation next to it.

在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)

你考虑过第三方拼写检查吗? 您可以将在C#中开发的自定义WinForms控件插入访问数据库吗? VB6控件怎么样? 如果你能找到一个使用第三方库进行拼写检查的控件,那可能会有效。 Have you considered a third party spell checker? Can you insert a custom WinForms controls developed in C# into an access database? What about a VB6 control? If

从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)

我有同样的问题,因为我在远程服务器上有两个图像,我需要在每天的预定义时间复制到我的本地服务器,这是我能够提出的代码... try { if(@copy('url/to/source/image.ext', 'local/absolute/path/on/server/' . date("d-m-Y") . ".gif")) { } else { $errors = error_get_last(); throw new Exception($err

从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))

我不确定我完全明白你在说什么。 你能编辑你的帖子并包含你正在做的Subversion命令/操作的特定顺序吗? 最好使用命令行svn客户端,以便容易为其他人重现问题。 如果您只是想获取文件的旧副本(即使该文件不再存在),您可以使用如下命令: svn copy ${repo}/trunk/moduleA/file1@${rev} ${repo}/trunk/moduleB/file1 其中${repo}是您的存储库的URL, ${rev}是您想要的文件的版本。 这将恢复该文件的旧版本,包括最高版本