bench_merge.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*
  2. * Tencent is pleased to support the open source community by making wwsearch
  3. * available.
  4. *
  5. * Copyright (C) 2018-present Tencent. All Rights Reserved.
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may not
  8. * use this file except in compliance with the License. You may obtain a copy of
  9. * the License at
  10. *
  11. * https://opensource.org/licenses/Apache-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OF ANY KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations under the License.
  17. */
  18. #include "include/header.h"
  19. #include "bench_merge.h"
  20. #include "random_creater.h"
  21. #include "staticstic.h"
  22. namespace wwsearch {
  23. // merge performance
  24. // * orginal implementation
  25. // * personal implementation
  26. //
  27. // Some tips:
  28. // * pre allocation array for heap
  29. // * reserve string size previous,or use buffer
  30. // 1000,0000 -> 50%
  31. // * implement heap algorithm
  32. //
  33. const char* BenchMerge::Description =
  34. "-q [queue_size] -n [doc id num] -r [run times] ";
  35. const char* BenchMerge::Usage = "Benchmark for merge doc list ";
  36. void BenchMerge::Run(wwsearch::ArgsHelper& args) { return; }
  37. bool BenchMerge::CurrDocListMerge(Codec* codec,
  38. const std::deque<std::string>& operand_list,
  39. std::string* new_value, bool purge_deleted) {
  40. return true;
  41. }
  42. } // namespace wwsearch