Giter VIP home page Giter VIP logo

charsetdetect's Introduction

Golang bindings for libdetectcharset

This is Go bindings for the C-library libdetectcharset which is itself a C-wrapper for the C++ library Universal Charset Detector by Mozilla.

I was interested in comparing performance of several available charset detectors and created this bindings for this purpose.

Performance

I bencharked four charset detectors available in Go:

The test was conducted on a MacBook Air 2013 (1.3 GHz Intel Core i5) using 1 CPU core. Test data – 4 HTML pages:

  • 106 KB – UTF-8
  • 105 KB – incorrect UTF-8
  • 521 KB - CP1251
  • 61 KB - KOI8-R
Detector (4x, full text) ns/op B/op allocs/op
Enca 7144856 64 4
CharsetDetect 8777701 64 4
ICU 36366853 2204 60
Chardet 68107438 53828 32
Detector (4x, 4096 bytes) ns/op B/op allocs/op
Enca 89757 64 4
CharsetDetect 187303 64 4
ICU 4393345 53824 32
Chardet 8906792 2165 60

endevit/enca was a clear winner both in speed and quality. aglyzov/charsetdetect was coming the second. So personally I recommend using endevit/enca instead.

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.