[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] libpsl design

From: Tim Rühsen
Subject: Re: [Bug-wget] libpsl design
Date: Sat, 22 Mar 2014 21:00:45 +0100
User-agent: KMail/4.11.5 (Linux/3.13-1-amd64; KDE/4.11.5; x86_64; ; )

I just added the creation of a second library (libpsl-inline) with a slightly 
different approach. A tool (psl2c) genrates C data structures from the PSL 
ASCII file. This file will be included by psl-inline.c to build libpsl-

There also is an own include file and a seperate test.

The API is similar to libpsl but needs not mallocs and the internal vector 
code is not needed any more.


The difference in CPU cycles is dramatic:

$ valgrind --tool=callgrind ./test-is-public
==19426== I   refs:      9,818,337

$ valgrind --tool=callgrind ./test-is-public
==19438== Collected : 167557

Going deeper with kcachegrind reveals that only ~30k cycles are consumed by 
psl_inline_init() + 10x psl_inline_is_public().

The caveat is of course the libraries size (stripped):

-rwxr-xr-x 1 tim tim   8744 Mär 22 20:56 libpsl-0.1.so.0.0.0
-rwxr-xr-x 1 tim tim 423064 Mär 22 20:56 libpsl-inline-0.1.so.0.0.0

Also, is creating the library with every change to affected_tld_names.dat 
reasonable ? How often does it change ?

I would still like to move the discussion to libpsl-bugs, but so far nobody is 
reading it ...



Attachment: signature.asc
Description: This is a digitally signed message part.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]