标签: performance-testing

在Perl中,访问1.6百万行键/值对的最快方法是什么?

我有一个1.6百万行的列表,如下所示:

N123HN  /var/foo/bar/baz/A/Alpha.file.1234.bin
N123HN  /var/foo/bar/baz/A/Alpha.file.1235.bin
N123KL  /var/foo/bar/baz/A/Alpha.file.1236.bin
Run Code Online (Sandbox Code Playgroud)

我有一个Perl脚本,它基本上只是在第二列上查看这些数据,作为在第一列中查找值的一种方式(然后它使用"N123HN"值进行其他魔术等).就像现在一样,我的应用程序花费大约4分钟摄取文件并将其加载到一个巨大的哈希(键/值数组)中.虽然由于显而易见的原因,类似grep的函数本身很慢,但运行此脚本的最慢部分是每次运行时都会大量获取数据.

任何人都有任何聪明的想法如何更快地访问这些数据?由于它只是两列的列表,因此对于此用例,关系数据库似乎非常重要.

我在这里重新编辑原始问题,因为将源代码粘贴到评论框中非常难看.

我用来摄取巨大文件的算法是这样的:

while(<HUGEFILE>)
    {
      # hugefile format:
      # nln N123HN ---- 1 0 1c44f5.4a6ee12 17671854355 /var/foo/bar/baz/A/Alpha.file.1234.bin 0

      next if /^(\s)*$/;      # skip blank lines
      chomp;                  # remove trailing newline characters
      @auditrows = split;     # an array of entire rows, split on whitespace
      my $file_url = $auditrows[7];              # /var/foo/bar/baz/A/Alpha.file.1234.bin 
      my $tapenum  = "$auditrows[1] ";          # N123HN
      $tapenumbers{ $file_url } = $tapenum;      # key   = "/var/foo/bar/baz/A/Alpha.file.1234.bin" 
    }                                           # value = "N123HN"
Run Code Online (Sandbox Code Playgroud)

database perl performance-testing bigdata

0
推荐指数
1
解决办法
418
查看次数

jenkins:性能插件仅在perf报告中显示最近的构建数据

我在jenkins中设置了jmeter作业,它应该发布*.jtl结果,然后将它们显示在一个漂亮的趋势图中.但是,如果我发现它们是在构建// performance-results/JMeter文件夹下发布的,那么趋势总是只显示当前结果.因此,如果我在一天内运行此构建三次 - 我会看到有三个点的图形.如果今天只有一次运行 - 我会在该图上看到1次运行.我没有在图表上看到昨天等结果.我希望看到这个趋势显示所有以前构建的所有数据,包括yesteday等.我应该检查什么,perf插件如何决定使用哪个*.jtl数据来显示数据?

在作业的设置中我有这个jtl源的正则表达式:**/*.jtl,所以我希望所有的构建数据都显示在趋势上...

jmeter performance-testing jenkins

0
推荐指数
1
解决办法
1938
查看次数

调整Postgresql后,PgBench的结果更糟

我在Digital Ocean的8gb Ram/4 CPU/80gb SSD云服务器上测试PostgreSQL.我最初使用postgresql.conf中的默认设置运行PgBench,然后更改了一些常用设置 - shared_buffers,work_mem,maintenance_work_mem,effective_cache_size - 以反映8gb的RAM.在运行第二组测试后,我注意到我的一些结果实际上更糟.有关为什么会这样的任何建议?我对PgBench很新,并且总体上调整了PostgreSQL.

设置:

  • shared_buffers = 2048mb
  • work_mem = 68mb
  • maintenance_work_mem = 1024mb
  • effective_cache_size = 4096mb

测试:

  • pgbench -i -s 100
  • pgbench -c 16 -j 2 -T 60 -U postgres postgres
  • pgbench -S -c 16 -j 2 -T 60 -U postgres postgres
  • pgbench -c 16 -j 4 -T 60 -U postgres postgres
  • pgbench -S -c 16 -j 4 -T 60 -U postgres postgres
  • pgbench -c 16 -j 8 -T 60 -U postgres postgres
  • pgbench …

postgresql performance-testing postgresql-9.1

0
推荐指数
1
解决办法
1930
查看次数

比较2种方法的性能

我有以下几点:

public class Logger
{
    public static void LogStartMethod(MethodBase method)
    {
        Console.WriteLine("{0} Method '{1}' started", DateTime.Now, method.Name);
    }

    public static void LogStartMethod1()
    {
        StackTrace stackTrace = new StackTrace();
        MethodBase method = stackTrace.GetFrame(0).GetMethod();
        LogStartMethod(method);
    }

    public static void LogStartMethod2()
    {
        MethodBase method = MethodBase.GetCurrentMethod();
        LogStartMethod(method);
    }
}
Run Code Online (Sandbox Code Playgroud)

我想确定 LogStartMethod1 或 LogStartMethod2 之间性能最高的方法...

让我们对具体方法的作用进行抽象,但是否有工具(在线或 Visual Studio 加载项)能够比较 2 种方法的性能?

我现在有很多商业性能分析器……我们应该付费或使用 Visual Studio Ultimate 来为整个解决方案提供性能工具……

我只想比较两种方法,仅此而已...

.net visual-studio-2010 performance-testing

0
推荐指数
1
解决办法
235
查看次数

Hadoop基准测试/性能测试

我想在我的Hadoop集群上执行基准测试和性能测试.我知道hadoop-mapreduce*test*.jar和hadoop-mapreduce-examples*.jar有许多用于基准测试的程序.

是否有可用于这些测试的文件,其中提供了每种测试和性能测量的详细信息?此外,在执行任何测试后,是否有可用于比较结果的值?

谢谢.

benchmarking hadoop performance-testing

0
推荐指数
1
解决办法
8088
查看次数

如何在Jmeter中为500个并发用户设置加速时间?

我们想证明我们为客户提供的REST API可以处理500个并发请求。为了实现这一点,设置加速时间的最佳方法是什么?

  1. 1秒内有500个请求吗?
  2. 5秒内有2500个请求?
  3. 还有其他选择吗?

使用第一个选项,该应用程序和Web服务器将被淹没。使用第二个选项,我应该如何进行设置?

感谢任何对此的投入。

jmeter load-testing performance-testing

0
推荐指数
1
解决办法
3250
查看次数

多线程在速度上没有任何改进 - 在C中使用pthread - 为什么?

为了在多线程中变得更加舒适,我编写了一个带有"密集"计算的小程序.它是mandelbrot集的图片,其中每个像素单独计算,然后像素缓冲到行.每个线程获得的总行数相等.因此,例如,如果选择的线程数是2,则具有1000行高度计算的图片应该以两个500行包结束.因此我建议速度种类减少两倍,但没有改善.为什么???我不明白,因为一切正常并且看似合乎逻辑.如果有人能给我一个提示,我将非常感激.下面你会看到main和一个由main调用的mandelbrot集的caluclation函数.

int main(int argc, char ** argv, char ** envp) {

if(argc != 4)
{
printf("Bitte genau 3 Argumente eingeben.\n");
 return 1;
}
//Structs und Variablen für die Stopuhr
struct timeval start, ende;
long ttlende, ttlstart;

width  = str2num(argv[1]);
height = str2num(argv[2]);

int y;
//char blueGreenRed[3];
//Ist Buffer für ganze Zeile: Breite * 3 wegen den 3 Bytes pro Pixel
//char zeile[width*3];

unsigned char info[BMPHEADER_SIZE] = {
              //size
    'B','M',  0,0,0,0, 0,0, 0,0, 54,0,0,0,
              //width  //height
    40,0,0,0, 0,0,0,0, 0,0,0,0,  1,0, 24,0, …
Run Code Online (Sandbox Code Playgroud)

c multithreading pthreads performance-testing

0
推荐指数
1
解决办法
430
查看次数

GPU性能计数器和驱动程序计数器是什么意思?

https://developer.nvidia.com/sites/default/files/akamai/tools/files/PerfKit_4_5_User_Guide.pdf

NVIDIA PerfKit SDK允许图形开发人员访问底层NVIDIA GPU
性能计数器和NVIDIA 驱动程序计数器

我想了解这些计数器的含义吗?它们是某种硬件还是软件?他们在做什么?

他们如何对我有帮助?请举例说明如何使用它们。

我必须使用Nvidia perfkit来确定某些处理机器人技术的软件的性能。

gpu nvidia performance-testing

0
推荐指数
2
解决办法
2251
查看次数

为什么执行结果在发布模式和调试模式中有很大差异?

# include <stdio.h>
# include<time.h>
# include <limits.h>

int main() {
    clock_t start;
    long a = 0;
    long b = 0;

    start = clock();
    for (int i = 0; i < INT_MAX; i++) {
        for (int j = 0; j < INT_MAX; j++) {
            for (int k = 0; k < INT_MAX; k++) {
                for (int q = 0; q < INT_MAX; q++) {
                    b = 1;
                }
            }
        }       
    }
    printf("%.5f\n", ((float)(clock() - start) / CLOCKS_PER_SEC));

    start = clock(); …
Run Code Online (Sandbox Code Playgroud)

c performance-testing

0
推荐指数
1
解决办法
86
查看次数

使用chrono衡量性能,顺序似乎很重要,尽管它不应该

作为练习,我试图衡量应该执行相同任务的两种算法的效率,即仅使用堆栈作为支持数据结构,对堆栈进行排序:

#include <stack>
#include <iostream>
#include <chrono>

std::stack<int> sortStack(std::stack<int>& inS){
  std::stack<int> tmpS;
  int tmpV=0;
  tmpS.push(inS.top());
  inS.pop();

  while(!inS.empty()){
    if(inS.top()>=tmpS.top()){
      tmpS.push(inS.top());
      inS.pop();
    }else{
      tmpV = inS.top();
      inS.pop();
      int count = 0;

      //reverse the stack until we find the item that is smaller
      while(!tmpS.empty()){
        if(tmpS.top()>tmpV){
          inS.push(tmpS.top());
          tmpS.pop();
          count++;
        }else{
          break;
        }
      }
      //tmpS.top is smaller (or =) than tmpV
      tmpS.push(tmpV);

      //and revert the other stack
      for(int i=0; i< count; i++){
        tmpS.push(inS.top());
        inS.pop();
      }
    }
  }

  return tmpS;
}

std::stack<int> sortStackRevisited(std::stack<int>& inS){
  std::stack<int> tmpS; …
Run Code Online (Sandbox Code Playgroud)

c++ algorithm performance performance-testing c++-chrono

0
推荐指数
1
解决办法
47
查看次数