-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lookup table to increase styling performance #179
Comments
Thanks @SunBlack! Just curious how big are your typical lookup tables and do you have any performance numbers? |
Typically we have around 10 entries. But there exists also some debug cases in which we have some hundreds (e.g. you could give each BATCH_ID an unique color). |
I wonder if it's possible to detect this for simple cases and create a lookup table, but all in the implementation. |
It should be possible in case following things are true:
In case parsed condition values are not monotonously de/increasing there should be a limit how many percent are not used. E.g. if you are using every time default color except the value is part of a geometric series it could increase performance if you are sing a lookup table - but we should not forget memory usage. Okay geometric series may be no real scenario, but we have not used values. So maybe start using a lookup table if there are more than 4 conditions (or 3, 5, ...=> performance check) and in case the difference between lowest and highest value are more than 10-20 values calculate percent usage of values. If the amount is to small split maybe into multiple lookup tables. Example:
Could be parsed to into a single loopup table like this:
But in general I don't believe it is worth to check this automatically. In case you have performance issue user can better optimize usage of lookup tables than a script. |
Noted this idea in #2 (comment) |
Currently styling performance can be slow in case you have multiple conditions.
E.g.
Results in a shader which looks like
In case of a GPU this is unnecessary slow, because if its SIMD architecture all conditions must be checked. Lookup tables can prevent this issue. A lookup table is usually implemented as array (or Texture in OpenGL).
Some idea how the syntax could be:
Another possible syntax is
Original issue see here
The text was updated successfully, but these errors were encountered: