Git Product home page Git Product logo

bloom_cpp's Introduction

This repo is now archived

DuckDuckHack went on maintenance mode in 2015 and we aren't in a position to continue it. This repo hasn't been maintained subsequently and so we are archiving it.

Need to report a bug?

If you find a bug or relevancy issue, the best way to report this is via the Feedback button on the DuckDuckGo.com search results page. These issues are compiled and reviewed daily.

Have a suggestion or idea?

The best way to report these is also via the Feedback button on the DuckDuckGo.com search results page.

You can also share your thoughts with our community on Reddit.

bloom_cpp's People

Contributors

andrey-p avatar brindy avatar jaceklyp avatar ryanhaining avatar samsymons avatar subsymbolic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bloom_cpp's Issues

Improve CMake build

Some suggestions for changes/cleanup to the CMake build structure that would help to position better for extensions with other tooling - such as #6 - for example:

  • Using a recursive arrangement and an add_directory() can make a build harder to follow for small projects, so consolidation could be considered simpler for a project with only a few source files
  • The Catch2 library is built and linked, but it just needs to be included as a single header
  • Explicitly setting the CMAKE_CXX_COMPILER as g++ makes the build less easy to use with clang, for example - these settings are usually best factored out to related toolchain files and referenced on the command line as -CMAKE_TOOLCHAIN_FILE=
  • The file empty.cpp looks like a holdover from an earlier stage, and isn't needed now for CMake to figure out the linker language
  • The bloom filter library in the CMakeLists.txt references the hpp file, which shouldn't be needed as it's not an independent translation unit

And related:

  • Using Catch2 as single header usually means splitting out a separate test runner cpp file to reduce recompile times, also better for scaling up test suite sizes

Improve binary filter load time

The bloom filter lookups are fast (nanoseconds rather than milliseconds on ~3million records) however the binary vector load time in readVectorFromStream is slow (seconds).

Ideally, we would improve this load time while still keeping the binary small and lookup times fast. This may mean moving the underlying data structure from a bool vector which is challenging to write to file as it doesn't store its elements as a contiguous array.

enh: `using namespace std` in header

Enhancement:

I appreciate in a 2-file project it's probably not so much an issue but you really shouldn't be putting using namespace std in a header file as this forcibly includes the whole std namespace for any implementation code that wishes to use the bloom.hpp header.

Avoiding placing using namespace std (or indeed any using namespace X) in a header is mentioned in so many places I forget where - maybe Exceptional C++ - / Sutter would be one, Scott Meyers' Effective STL almost certainly another (Bjarne Stroustrup C++ Prog Lang another?) - but one ref I did just find an old classic from Sutter's GOTW: http://gotw.ca/gotw/053.htm see Section 2, Guideline #1:

  1. Using directives should be avoided entirely, especially in header files

Sutter also makes the distinction here - as I did above - in a footnote that this guideline is valid for shared header files (i.e. used by more than one cpp) : http://gotw.ca/gotw/053.htm#1 so you could argue "no change here" since only one cpp, but then you could also argue that it is simply poor style - which I why I label this as an enhancement

BTW: nothing against using namespace std in your cpp, should you wish to do so - so this is probably a one-line change: remove using namespace std from the header and add it to the cpp. Depending on where you place the using in your cpp, you may need to fully qualify any STL types in the header file.

I can fork this repo and supply a PR with change if you accept this as an (enhancement) issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.