Giter VIP home page Giter VIP logo

Comments (4)

gunesacar avatar gunesacar commented on May 26, 2024 1

We got a ~10x speed increase by limiting ourselves to CSSStyleDeclaration interface (=275 declarations) instead of iterating over it as an ordinary object (~1200 declarations+naming variations):
gunesacar/OpenWPM@36b0922

This is much better than hand-picking style values as we now store all style info. Closing...

from dark-patterns.

gunesacar avatar gunesacar commented on May 26, 2024

Here is how I plan to do this: http://jsfiddle.net/ba80ehnv/1/
We'll store the diff of computed style and default style.

The code is not optimized at the moment, we can obviously memoize or precompute default style lookups.
@aruneshmathur does it look good to you?

One further optimization would be to exclude CSS properties like perspective-origin which seem to change values based on element dimensions.

from dark-patterns.

gunesacar avatar gunesacar commented on May 26, 2024

This is added in gunesacar/OpenWPM@568a852
It looks like we have to optimize the part where we compare default element style to computed style. It takes around 15ms, and 50% of total CPU time (as reported by Devtool's Performance measurement)

from dark-patterns.

gunesacar avatar gunesacar commented on May 26, 2024

We've decided against storing all style information; instead we'll handpick more basic style attributes like text color, background color, text size etc.

from dark-patterns.

Related Issues (20)

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.