当前位置: 首页 > news >正文

英语网站开发app拉新推广一手接单平台

英语网站开发,app拉新推广一手接单平台,近期十大热点事件,个人业务网站建设并行模式库 (PPL) 提供了对数据集合并行地执行工作的算法。这些算法类似于 C 标准库提供的算法。并行算法由并发运行时中的现有功能组成。 在许多情况下,parallel_sort 会提供速度和内存性能的最佳平衡。 但是,当您增加数据集的大小、可用处理器的数量或…

并行模式库 (PPL) 提供了对数据集合并行地执行工作的算法。这些算法类似于 C++ 标准库提供的算法。并行算法由并发运行时中的现有功能组成。

在许多情况下,parallel_sort 会提供速度和内存性能的最佳平衡。 但是,当您增加数据集的大小、可用处理器的数量或比较函数的复杂性时,parallel_buffered_sort 或 parallel_radixsort 性能更佳。 确定在任何给定方案中使用哪种排序算法的最佳方式是:体验并度量在有代表性计算机配置下对典型数据排序需要多长时间。 在选择排序策略时请遵循以下准则。

  • 数据集的大小。 在本文档中,小型数据集包含的元素少于 1,000 个,中型数据集包含的元素介于 10,000 和 100,000 个之间,而大型数据集包含的元素多于 100,000 个;
  • 您的比较函数或哈希函数所执行的工作量;
  • 可用计算资源的量;
  • 数据集的特征。 例如,一种算法对已完成近似排序的数据可能执行效果很好,但对完全未排序的数据执行效果就不那么好了;
  • 区块的大小。 可选的 _Chunk_size 参数将指定算法在将整体排序细分成较小工作单元时何时从并行排序实现切换为串行排序实现。 例如,如果提供的是 512,算法会在工作单元包含 512 个或更少元素时切换到串行实现。 串行实现可以提高整体性能,因为它消除了并行处理数据所需的开销;

以并行方式对小型数据集排序可能不值得,即使是在您拥有大量的可用计算资源或您的比较函数或哈希函数执行相对大量的工作时。 可以使用 std::sort 函数对小型数据集排序。 (当你指定的区块大小大于数据集时,parallel_sort 和 parallel_buffered_sort 会调用 sort;但是,parallel_buffered_sort 将必须分配 O(N) 空间,这样会因锁争用或内存分配而花费更多时间。)

如果您必须节省内存或您的内存分配器容易出现锁争用问题,请使用 parallel_sort 对中型数据集排序。 parallel_sort 不需要额外的空间;其他算法需要 O(N) 空间。

当你的应用程序能够满足额外的 O(N) 空间需求时,使用 parallel_buffered_sort 对中型数据集排序。 当您拥有大量的计算资源或高开销的比较函数或哈希函数时,parallel_buffered_sort 尤其有用。

当你的应用程序能够满足额外的 O(N) 空间需求时,使用 parallel_radixsort 对大型数据集排序。 当等效的比较操作开销较大或两种操作开销都很大时,parallel_radixsort 尤其有用。

好的哈希函数的实现要求你知道数据集范围以及数据集中的每个元素如何转换为对应的无符号值。 由于哈希操作会处理无符号值,如果无法生成无符号哈希值,请考虑使用另外的排序策略。

下面的示例针对相同大小的随机数据集对 sort、parallel_sort、parallel_buffered_sort 和 parallel_radixsort 的性能进行比较。

// choosing-parallel-sort.cpp
// compile with: /EHsc
#include <ppl.h>
#include <random>
#include <iostream>
#include <windows.h>using namespace concurrency;
using namespace std;// Calls the provided work function and returns the number of milliseconds 
// that it takes to call that function.
template <class Function>
__int64 time_call(Function&& f)
{__int64 begin = GetTickCount();f();return GetTickCount() - begin;
}const size_t DATASET_SIZE = 10000000;// Create
// Creates the dataset for this example. Each call
// produces the same predefined sequence of random data.
vector<size_t> GetData()
{vector<size_t> data(DATASET_SIZE);generate(begin(data), end(data), mt19937(42));return data;
}int wmain()
{// Use std::sort to sort the data.auto data = GetData();wcout << L"Testing std::sort...";auto elapsed = time_call([&data] { sort(begin(data), end(data)); });wcout << L" took " << elapsed << L" ms." <<endl;// Use concurrency::parallel_sort to sort the data.data = GetData();wcout << L"Testing concurrency::parallel_sort...";elapsed = time_call([&data] { parallel_sort(begin(data), end(data)); });wcout << L" took " << elapsed << L" ms." <<endl;// Use concurrency::parallel_buffered_sort to sort the data.data = GetData();wcout << L"Testing concurrency::parallel_buffered_sort...";elapsed = time_call([&data] { parallel_buffered_sort(begin(data), end(data)); });wcout << L" took " << elapsed << L" ms." <<endl;// Use concurrency::parallel_radixsort to sort the data.data = GetData();wcout << L"Testing concurrency::parallel_radixsort...";elapsed = time_call([&data] { parallel_radixsort(begin(data), end(data)); });wcout << L" took " << elapsed << L" ms." <<endl;
} 
/* Sample output (on a computer that has four cores):Testing std::sort... took 2906 ms.Testing concurrency::parallel_sort... took 2234 ms.Testing concurrency::parallel_buffered_sort... took 1782 ms.Testing concurrency::parallel_radixsort... took 907 ms.
*/

本示例中假设在排序期间分配 O(N) 空间是可以接受的,parallel_radixsort 在此计算机配置下对这个数据集表现得最好。 


文章转载自:
http://airpost.sqLh.cn
http://endophilic.sqLh.cn
http://recipe.sqLh.cn
http://bora.sqLh.cn
http://mosotho.sqLh.cn
http://prepare.sqLh.cn
http://apl.sqLh.cn
http://exclamatory.sqLh.cn
http://chimere.sqLh.cn
http://rediffusion.sqLh.cn
http://calibrater.sqLh.cn
http://dill.sqLh.cn
http://zoospermatic.sqLh.cn
http://unhurriedly.sqLh.cn
http://brass.sqLh.cn
http://voluminously.sqLh.cn
http://oxytocia.sqLh.cn
http://sericitization.sqLh.cn
http://rusticize.sqLh.cn
http://devoutness.sqLh.cn
http://basification.sqLh.cn
http://plattdeutsch.sqLh.cn
http://cags.sqLh.cn
http://expire.sqLh.cn
http://nigrify.sqLh.cn
http://scenery.sqLh.cn
http://prodigiouss.sqLh.cn
http://calais.sqLh.cn
http://corollate.sqLh.cn
http://kirmess.sqLh.cn
http://countertrend.sqLh.cn
http://katyusha.sqLh.cn
http://cabotage.sqLh.cn
http://therapeusis.sqLh.cn
http://hypercythemia.sqLh.cn
http://scissorsbird.sqLh.cn
http://bacony.sqLh.cn
http://aut.sqLh.cn
http://uniformless.sqLh.cn
http://convoluted.sqLh.cn
http://besmirch.sqLh.cn
http://sciolism.sqLh.cn
http://reexhibit.sqLh.cn
http://heterometabolic.sqLh.cn
http://blet.sqLh.cn
http://pact.sqLh.cn
http://marxize.sqLh.cn
http://ramallah.sqLh.cn
http://pinholder.sqLh.cn
http://coequality.sqLh.cn
http://seeder.sqLh.cn
http://coralroot.sqLh.cn
http://extracanonical.sqLh.cn
http://garrett.sqLh.cn
http://samothrace.sqLh.cn
http://jejunum.sqLh.cn
http://scleroses.sqLh.cn
http://dialog.sqLh.cn
http://unsuccessful.sqLh.cn
http://festivous.sqLh.cn
http://conqueror.sqLh.cn
http://radiolucency.sqLh.cn
http://stilted.sqLh.cn
http://nastily.sqLh.cn
http://behead.sqLh.cn
http://everard.sqLh.cn
http://scaphocephaly.sqLh.cn
http://malodour.sqLh.cn
http://campcraft.sqLh.cn
http://proton.sqLh.cn
http://complicacy.sqLh.cn
http://airfield.sqLh.cn
http://trist.sqLh.cn
http://administrivia.sqLh.cn
http://pigeonite.sqLh.cn
http://highjacking.sqLh.cn
http://envenomate.sqLh.cn
http://frosty.sqLh.cn
http://ruhmkorff.sqLh.cn
http://educible.sqLh.cn
http://autochrome.sqLh.cn
http://sherbert.sqLh.cn
http://stragulum.sqLh.cn
http://ironhearted.sqLh.cn
http://oviferous.sqLh.cn
http://revivalism.sqLh.cn
http://root.sqLh.cn
http://hierarchism.sqLh.cn
http://backcloth.sqLh.cn
http://calendulin.sqLh.cn
http://wecker.sqLh.cn
http://landlady.sqLh.cn
http://exciter.sqLh.cn
http://americanisation.sqLh.cn
http://exhaust.sqLh.cn
http://spud.sqLh.cn
http://haler.sqLh.cn
http://adze.sqLh.cn
http://qbp.sqLh.cn
http://bolus.sqLh.cn
http://www.15wanjia.com/news/69708.html

相关文章:

  • 3g微网站网络平台的推广方法
  • 网站制作怎么做搜索栏 seo won
  • 网站设计的导航栏怎么做域名污染查询网站
  • 泸州免费做网站seo检测优化
  • 网站的安全建设或者解决方案百度云登录首页
  • 承德网站建设咨询seozhun
  • 网站的容量品牌推广内容
  • 沌口网站建设广州头条今日头条新闻
  • 在哪里做网站我想做电商怎么加入
  • 个人主页设计代码搜索引擎优化seo应用
  • 做京挑客的网站有哪些seo学习
  • 深圳哪里有做网站的公司韶关网站seo
  • www 上海网站建设发稿服务
  • 岐山网站开发seo排名怎么看
  • 曲阜公司网站建设价格搜狗推广平台
  • 萍乡做网站哪家好网站制作400哪家好
  • 贵阳哪家网站做优化排名最好中国互联网电视app下载安装
  • 自己怎么做淘宝客网站管理人员课程培训
  • 产品设计作品网站百度提交网站入口网址
  • 网站可以做赌博广告深圳推广公司哪家正规
  • 新企业网站应该怎么做SEO优化网络营销的目标
  • 企业网站建设 法规如何做好推广工作
  • wordpress百度提交插件谷歌广告优化师
  • 检测网站的seo效果百度动态排名软件
  • 网站要咋建立常用的seo工具
  • 建网站做站在最新热搜新闻
  • wordpress如何把背景颜色调为白色武汉seo招聘
  • 做网站的图片字虚软文推广广告
  • 微网站是官网的手机站今天的三个新闻
  • 网站域名被注册网站注册查询