Comments (4)
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.
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.
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.
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)
- Attribute DOM changes to scripts HOT 1
- Move product attribute code to Javascript HOT 1
- Store number of buttons, imgs, links inside each segment HOT 1
- Store details of the longest text node of each segment HOT 1
- Handle cases where computed style is null HOT 4
- Integrate segmentation into mutation summary event flow HOT 2
- Rate limit/throttle segmentation and element snapshots HOT 1
- Add unique IDs to elements HOT 1
- Handling body elements with 0 width and height
- Build a clustering dashboard HOT 1
- Incorrect background-color value HOT 3
- Link segments to phases HOT 2
- Evaluate the accuracy of shopping website detection HOT 2
- Evaluate accuracy of checkout crawler HOT 1
- Limit product attribute selection HOT 1
- Clustering preprocessing
- Related Work section HOT 1
- Introduction section
- Methods section HOT 1
- Clean up the analysis notebooks
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dark-patterns.